Question
main ( )
{
float a=4.1589;
printf("%2.1f", a);
return 0;
}
a.
4
b.
4.1
c.
4.2
d.
4
Posted under C Programming
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What is the output of this program?
Similar Questions
Discover Related MCQs
Q. The for statement can precede a loop to be executed 50 times or till a boolean variable "found" become false is given by
View solution
Q. For x and y are variables as declared below
double x=0.005,y=-0.01;
What is the value of ceil(x+y)
View solution
Q. Find the output of the following :
for (i=1,j=10;i
View solution
Q. What does the statement
printf("%d",10?0?5:1:12);
prints :
View solution
Q. Printf("%d"printf("tim"));
View solution
Q. In a 'C' program, constant is defined
View solution
Q. What will be the value of x and y after execution of the following statement (C language)
n ==5;x=n++;y=-x;?
View solution
Q. Consider following statements:
putchar(getchar());
putchar(getchar());
If
a
b
is the input, then output will be
View solution
Q. If following variables are set to the values as shown below, then what is the value of the expression following it?
answer=2;
marks=10;
!((answer2))
View solution
Q. The statement
printf ( "%d" , sizeof (" "'));
prints
View solution
Q. The statement
printf ("%d", ( a++) ) ;
prints
View solution
Q. The statement
printf ("%d", ++5) ;
prints
View solution
Q. The statement
printf ("%d", 10 ? 0 ? 5 : 11 : 12 ) ;
prints
View solution
Q. int i = 5;
is a statement in a C program.Which of the following are true?
View solution
Q. printf("ab", "cd", "ef");
prints
View solution
Q. Consider the declaration
static char hello[ ] = " hello " ;
The output of printf( " % s \ n ", hello) ;
will be the same as that of
View solution
Q. If a = 9, b = 5 and c = 3,
then the expression ( a - a/b * b % c) > a % b % c
evaluates to
View solution
Q. The following statement
prlntf( ‘%f ’, 9/5) ;
prints
View solution
Q. printf( "%c", 100);
View solution
Q. x - = y + 1; means
View solution
Suggested Topics
Are you eager to expand your knowledge beyond C Programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!
Software Engineering
Learn about the systematic approach to developing software with our Software...
Microprocessor
Understand the heart of your computer with our Microprocessor MCQs. Topics include...
Operating System
Dive deep into the core of computers with our Operating System MCQs. Learn about...