C Programming Code Snippets For Competitive Exams page 1

C Programming Code Snippets For Competitive Exams

1. Find the output

void main() 

    printf(”%d”); 
}




Show Answer ?

2. What is output ?

main() 

    printf(5+”learner india); 
}




Show Answer ?

3. Find out put

void main() 

    int success(); 
    int (*sun)(); 
    sun = success; 
    (*sun)(); 
    printf(“%d”,(*sun)()); 
}    
int success() 

    printf(“Hello”); 
    return (3.33); 




Show Answer ?

4. Find output

Aaa()
{
    printf(“Hi”);

Bbb()
{
    printf(“Hello”);

Ccc()
{
    printf(“Bye”);

void main() 

    int (*ptr[3])(); 
    ptr[0] = Aaa; 
    ptr[1] = Bbb; 
    ptr[2] = Ccc; 
    ptr[2](); 
}




Show Answer ?

5.

struct temp 

    int a; 
    struct temp no_roll; 
    double c; 
}obj;




Show Answer ?

6.

int takefirst(int a,int b,int c) 

    return (++a,b+2,c); 

void main( ) 

    static int m,n; 
    m = takefirst(n,m,n); 
    printf(“%d”,m); 
}




Show Answer ?

7. Find output of fallowing program

void main() 

    printf("Today r is a7 great tr\day"); 




Show Answer ?

8. What is output ?

void main( ) 

    int i=107,x=5; 
    printf((x>7)?”%d”:”%c”,i); 




Show Answer ?

9. If a=-11 and b=-3 what is the value of a%b?




Show Answer ?

10. Find output

int show(int v) 

     if(v= =1||v= =0) 
          return 1; 
     if(v % 2==0) 
          return show(v/2) +2; 
     else 
          return show(v-2) +3; 

void main( ) 

     int z; 
     z = show(7); 
     printf(“%d”,z); 




Show Answer ?