Question

C Programming Given the following variable declarations and initializations: double num1 = 31.0; double num2 =...

C Programming

  1. Given the following variable declarations and initializations:

double num1 = 31.0;

double num2 = 15.5;

char letter = ‘A’;

Do the following expressions evaluate to true or false?

  1. num1 > num2 || num2 < 0
  2. num1 >= num2 * 2 && letter == ‘A’
  3. num1 < num2 || letter != ‘X’ && num2 < num1
  4. !(letter == ‘A’ || letter == ‘a’)
  5. num2 + num1 <= 50 && letter == ‘a’
0 0
Add a comment Improve this question Transcribed image text
Answer #1
a)
true

b)
true

c)
true

d)
false

e)
false

\;\;

Add a comment
Know the answer?
Add Answer to:
C Programming Given the following variable declarations and initializations: double num1 = 31.0; double num2 =...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Given following method, public static double getQuotient (int num1, int num2){ return num1/(double) num2; } Write...

    Given following method, public static double getQuotient (int num1, int num2){ return num1/(double) num2; } Write Java statement to invoke the method.

  • This is an external javascript file // Problem 1:   Declare the variables num1, num2, ans1, //  ...

    This is an external javascript file // Problem 1:   Declare the variables num1, num2, ans1, //               greet1, greet2. Then initialize them to //               hold the values 1, 2, 0, "Hello", and //               "World", respectively. var num1 = 1; var num2 = 2; var ans1 = 0; var greet1 = "Hello"; var greet2 = "World"; // Problem 1a:   Display the values stored in the previous //               variables in the...

  • 25. Given the array declaration double xyz [20]: which of the following statements are true? a....

    25. Given the array declaration double xyz [20]: which of the following statements are true? a. The array may hold up to 20 elements which may be accessed by the subscripts 0 through 20 b. The array may hold up to 21 elements which may be accessed by the subscripts 0 through 20 c. The array may hold up to 21 elements which may be accessed by the subscripts 0 through 19 d. The array may hold up to 20...

  • C programing - can you check my work? Given the following variable declarations complete the table...

    C programing - can you check my work? Given the following variable declarations complete the table below. Assume the proper header files have been included. char a, b, C; int d,e - 20. f = 16 : int *p = NULL, , **q = NULL, *r = NULL; double g, h, i; double *s = NULL , *t = NULL , *u = NULL; Expression For each expression list what the variable declaration would look like. Data Type C Declaration...

  • Given the following: struct Val { int num1; float num2; } ; struct Person { int...

    Given the following: struct Val { int num1; float num2; } ; struct Person { int age; float income; }; Val t, s; Person p1, p2, p3;                                        s.num1 = 0; s.num2 = 2.5;                          //initialize s p2.age = 25; p2.income = 9999.99;                //initialize p2 t = s;                            //assignment one p1 = s;                       //assignment two p2 = p3;                      //assignment three p3.age = s.num1;     //assignment four p3.income = s.num1;   //assignment five p2.age = t.num2;      //assignment six For each assignment statements above...

  • Last Coding Question! C++ is the programming language used This one is very difficult. My to...

    Last Coding Question! C++ is the programming language used This one is very difficult. My to do list is as follows: // This program uses a function to swap the values in two variables. /*TO DO: change the function swapNums to use two pointer parameters instead of two reference parameters, and then modify the complete program accodingly. */ #include <iostream> using namespace std; // Function prototype void swapNums(int&, int&); /***** main *****/ int main() { int num1 = 5, num2...

  • Hi, this program is in C. Can you a pass by pointer in this program. Thanks. #include //function ...

    Hi, this program is in C. Can you a pass by pointer in this program. Thanks. #include //function declaration/prototype here int main(int argc, char * argv[]) { int num1, num2;    printf("Please enter two integers (separated by ,):\n"); scanf("%d,%d", &num1, &num2); //enter two integers separated by a comma (,)    printf("num1 stores: %d\n", num1); printf("num2 stores: %d\n", num2);    /*make a function call to make sure the followings are true after we call the function (1) variable num1 stores the larger value after...

  • Question 5 (1 point) Using the following declarations, identify the scope that applies to the variables...

    Question 5 (1 point) Using the following declarations, identify the scope that applies to the variables a, b, c and d. c nst b 1 a = true; void f (double b) char c for (int d = 0; d < 2; d++) cout << b << c << endl: 1. global 2. local

  • For two given array declarations: int x[3] and double y[3], which of the following is FALSE?...

    For two given array declarations: int x[3] and double y[3], which of the following is FALSE? o the memory size of x and y is same. O the last element of y is at subscript 2 O x and y are located at different memory locations o y can store the value 3.14 at any of its valid index

  • bcswebdav/pid-6788375-dt-content-rid-73446427 2/courses/2182-INTRO-COMPUTERS--PROGRAMMING Write for each letter (a-c) Yes, the If statement will execute" or "No, the...

    bcswebdav/pid-6788375-dt-content-rid-73446427 2/courses/2182-INTRO-COMPUTERS--PROGRAMMING Write for each letter (a-c) Yes, the If statement will execute" or "No, the if statement will not execute" depending on the variables given. the statement does not execute, explain why. Use the same Answers document used in problem 1. while(((num!--num3 Ⅱ break; a) int num1-3; int num2 4; int num3-5; String firste"moon: String second "sun"; String third-"moon; b) int num1-3; int num2-4 int num3-5; String first- "dog" String second-"sun; String third"moon": c) int num1-3; int num2-3; int...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT