Showing posts with label cbse net solved c programming questions. Show all posts
Showing posts with label cbse net solved c programming questions. Show all posts

Thursday, March 2, 2017

C Programming Questions with Explanation

Q:: C programming:::
What will be the output?
void main()
{
         static int i=0;
         if(++i)
        {
                  printf("℅d",i);
                  main();
        }
}

(A) 1,1,1,1...
(B) 0,0,0,0...
(C) 1,2,3,4...
(D) None of these

Answer:: (D)

Explanation:

It will go upto range of integer here we are considering int takes 2 bytes.

1,2,3,4 ...32766,32767,-32768,-32767...-2,-1

Monday, February 20, 2017

C Programming Questions with Explanation

The following statement ::
     
               printf("%d",++5);
will print:

a)5  b) 6  c) error  d)garbage

Answer:: (C)

Explanation::

The statement will be expanded like
         5=5+1;
i.e. a constant on left side of expression which is not allowed in 'C' hence it will generate error.

Coding Acceleration Program

🚀 CODING ACCELERATION PROGRAM (90 DAYS) Build Strong Foundations Learn to Think Like a Programmer Get Placement Ready 💡 Learn C Progra...