• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

C Data Types

Question 11

Suppose a C program has floating constant 1.414, what\'s the best way to convert this as "float" data type?
  • (float)1.414
  • float(1.414)
  • 1.414f or 1.414F
  • 1.414 itself of "float" data type i.e. nothing else required.

Question 12

In a C program, following variables are defined: C
 float      x = 2.17;
 double   y = 2.17;
 long double z = 2.17;
Which of the following is correct way for printing these variables via printf.
  • printf("%f %lf %Lf",x,y,z);
  • printf(“%f %f %f”,x,y,z);
  • printf("%f %ff %fff",x,y,z);
  • printf("%f %lf %llf",x,y,z);

Question 13

“typedef” in C basically works as an alias. Which of the following is correct for “typedef”?
  • typedef can be used to alias compound data types such as struct and union.
  • typedef can be used to alias both compound data types and pointer to these compound types.
  • typedef can be used to alias a function pointer.
  • typedef can be used to alias an array.
  • All of the above.

Question 14

In a C program snippet, followings are used for definition of Integer variables? C
  signed s;
  unsigned u;
  long l;
  long long ll;
Pick the best statement for these.
  • All of the above variable definitions are incorrect because basic data type int is missing.
  • All of the above variable definitions are correct because int is implicitly assumed in all of these.
  • Only “long l;” and “long long ll;” are valid definitions of variables.
  • Only “unsigned u;” is valid definition of variable.

There are 14 questions to complete.

Last Updated :
Take a part in the ongoing discussion