Sunday, 27 May 2012

Aptitude questions and answers in c

C
programming aptitude questions and answers




Aptitude
questions in interview




Total question: 32

Time: 60 minute

Total marks: 64



1. Find out the error if any, in the program.



#include

int main(){

    int i=1;

    switch(i){

         case 1: printf("\radioactive cats have 18 half-lives");

         break;

         case 1*2+4: printf("\bottle for rent -inquire within");

C basic questions



C
basic interview questions and answers for freshers





(1)



void main(){

    char i;

    clrscr();

    for(i=120;i<=128;i++){

         printf("%d ",i);



    }

    getch();

}



Output: Infinite loop



(2)



void main(){

    int i;

    clrscr();

    for(i=0,i++,i<=5;i++,i<=2;i=0,i<=5,i+=3){

         printf("%d ",i);

    }

    getch();

}



Output: 2

(3)



void main(){

Multiple choice questions in c