Tuesday 22 September 2015

Tricky C Language Online Quiz Questions And Answers

61. What will be the output of following program ?
      #include<stdio.h>
       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,0
d. Error
Answer: B

62. What will be the output of following program ?
          #incllude<stdio.h>
          int main( )
          {
              int a,b;
              a = -3 - - 25;
              b = -3 - - (-3);
              printf("a=%d b=%d\n",a,b);
              return 0;
          } 
 

a. a = 22  b = -6
b. a = -6  b = 22
c. a =  3   b = 3
d. No Output
Answer: A

63. What will be the output of following program ?
           #include<stdio.h>
           int main( )
           { 
                 float a=5,b=2;
                 int c,d;
                 c =a%d;
                 d =a/2;
                 printf("%d\n",d);
                 return 0;
           }  

a. 3
b. 2
c. Error
d. None of above
Answer: C

64.  What will be the output of program ?
       #include<stdio.h>
       int main( )
       {
           printf("nn /n/n nn/n");
           return 0;
       }  

a. Nothing
b. nn /n/n nn
c. nn /n/n
d. Error
Answer: B

65  What will be the output of program ?
         #include<stdio.h>
         int main( )
         {
                int a,b;
               printf("Enter two values of a and b");
               scanf("%d%d",&a,&b);
               printf("a=%d b=%d"a,b);
               return 0;
         }

a. a = 0  b = 0
b. a = 1  b = 1
c. Values you entered
d. None of above
Answer: C

More Questions & Answers:-
Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 
Page10 Page11 Page12 Page13

No comments:

Post a Comment