728by90ad 
     
 
			C Preprocessor Questions And Answers.  
		 
  		   
          
		   
		       Exercise ::
		       C Preprocessor  
		   
		    
		
		    
			   Answer:   Option  A  
Explanation:  
		    
		Bitwise operators :&  is a Bitwise AND operator.
Logical operators :&& || !  is a NOT operator.
So, '& '
  See More Information 
			Published by:Michael Daani  
		 2. What will the SWAP macro in the following program be expanded to on preprocessing? will the code compile? 
#include<stdio.h> 
#define SWAP(a, b, c)(c t; t=a, a=b, b=t) 
int  main()
{
    int  x=10 , y=20 ;
    SWAP(x, y, int );
    printf("%d %d\n" , x, y);
    return  0 ;
} A.  It compiles B.  Compiles with an warning C.  Compiles and print nothing D.  Not compile 
    View Answer   Discuss forum  
     Workplace      Report   
    
		
		    
			   Answer:   Option  D  
Explanation:  
		    
		The code won't compile since declaration of t  cannot occur within parenthesis.
  See More Information 
			Published by:Michael Daani  
		 3. In which stage the following code? 
#include<stdio.h> stdio.h 
 A.  During editing B.  During linking C.  During linking D.  During preprocessing 
    View Answer   Discuss forum  
     Workplace      Report   
    
		
		    
			   Answer:   Option  D  
Explanation:  
		    
		The preprocessor replaces the line #include <stdio.h> 'stdio.h'  #include 
  See More Information 
			Published by:Michael Daani  
		 4. What will be the output of the program? 
#include<stdio.h> 
#define MAN(x, y) ((x)>(y)) ? (x):(y); 
int  main()
{
    int  i=10 , j=5 , k=0 ;
    k = MAN(++i, j++);
    printf("%d, %d, %d\n" , i, j, k);
    return  0 ;
} A.  12, 6, 12 B.  11, 5, 11 C.  11, 5, Garbage D.  12, 6, Garbage 
    View Answer   Discuss forum  
     Workplace      Report   
    
		
			Published by:Michael Daani  
		 5. What will be the output of the program? 
#include<stdio.h> 
#define SQUARE(x) x*x 
int  main()
{
    float  s=10 , u=30 , t=2 , a;
    a = 2 *(s-u*t)/SQUARE(t);
    printf("Result = %f" , a);
    return  0 ;
} A.  Result = -100.000000 B.  Result = -25.000000 C.  Result = 0.000000 D.  Result = 100.000000 
    View Answer   Discuss forum  
     Workplace      Report   
    
		
			Published by:Michael Daani