Thursday 9 November 2017

Printf Questions in C

-------------------------------------------------------------------------------------------------
Previous Page          Home                Last Page
--------------------------------------------------------------------------------------------------

6.
What will be the output of following program ?

#include
int main( ){
int i=2,j=3,k,l;
float a,b;
k = i/j * j;
l = j/i * j;
a = i/j * j;
b = j/i * i;
printf("%d %d%f%f\n",k,l,a,b);
return 0;
}

A. 3, 0, 0, 0
B. 0, 3, 0.000000, 2.000000
C. 0,0,0,0d.
D. Error
------------------------------------------------------------------------------------------------

7.
The value of EOF is_____.

A. -1
B.  0
C.  1
D. 10

Answer: A
------------------------------------------------------------------------------------------------

8.
Find the output?

#include
void main()
{
clrscr();
printf("%d",printf("CQUESTIONBANK"));
getch();
}

A. 13CQUESTIONBANK
B. CQUESTIONBANK13
C. Garbage CQUESTIONBANK
D. Compiler error

Answer: (B)
-----------------------------------------------------------------------------------------------

9.
calloc() belongs to which library

A. stdlib.h
B. malloc.h
C. calloc.h
D. None of above


Answer: A
----------------------------------------------------------------------------------------------

10.
To access the members of structure which symbol is used
A. *
B. -
C. ,
D. .

Answer: D
-------------------------------------------------------------------------------------------------
Previous Page             Home             Last Page
-------------------------------------------------------------------------------------------------

More Imp Topics: 

Data Types       
Operators
Pointers
Array
Preprocessor
Structures
Control Structures





100+ Best Home Decoration Ideas For Christmas Day 2019 To Make Home Beautiful

Best gifts for Christmas Day | Greeting cards for Christmas Day | Gift your children a new gift on Christmas day This Christmas d...