Menu

Output Produced Following Statements Printf 5d 6d 123 1234 Printf 102e 12345 Printf 5f 123 Q43813422

  1. What output is produced for each of the followingstatements?
    1. Printf(“%5d, %6d”, 123, 1234);
    2. Printf(“%10.2e”, 12.345);
    3. Printf(“%.5f” 12.345);
  1. If c is a variable of type char,which one of the following statements is illegal?
    1. Put char(c);
    2. Printf(c);
    3. C = ‘c’;
    4. C = ‘5’;
    5. C = 50;
    6. C = 3 + c * 2;
  1. Suppose that i is a variable of type int,j is a variable of type long, and k is avariable of type unsigned int. what is the type of theexpression:

(long) i + (int) j *k

  1. Suppose that i is a variable of type int,f is a variable of type float, and d is avariable of type double. what is the type of theexpression:

i * f / d

  1. Suppose that value is a variable of typefloat, num is a variable of type long,and sum is a variable of type int. Explain whatconversions take place during execution of the followingstatement:

sum = value +num;

  1. Write a single C statement that performs each of thefollowing tasks:
    1. Display each of the words below on a separateline:

All you need islove

  1. Output the value of double variabletemp using printf()
  2. Read three doubles from the keyboard and store thevalue entered into double variables value1, value2,value3.
  3. Print the double 123.456789 with 2 digits ofprecision. What value is printed?
  4. Print the floating-point value 3.14159f with 3digits to the right of the decimal point. What value isprinted?
  5. Print “The sum equals: “followed by theinteger value of variable sum

Expert Answer


Answer to What output is produced for each of the following statements? Printf(“%5d, %6d”, 123, 1234); Printf(“%10.2e”, 1…

OR