ThePrismSolutions

ThePrismSolutions

Practice(TEST 3)

1. What is the output of the below c code?

#include<stdio.h>	
main()
{
int i=5;
printf("%d%d%d%d%d%d",i++,i--,++i,--i,i);
}





2. How would you insert pre-written code into a current program ?

#define square(x) x*x
main()
{
int i;
i = 64/square(4);
printf("%d",i);
}




3. Predict the output or error(s) for the following ?

main()
{
char *p="hai friends",*p1;
p1=p;
while(*p!='\0') ++*p++;
printf("%s   %s",p,p1);
}





4. Predict the output or error(s) for the following ? ?

#include 
#define a 10
main()
{
#define a 50
printf("%d",a);
}





5. Predict the output or error(s) for the following ?

	
#define clrscr() 100
main()
{
clrscr();
printf("%d\n",clrscr());
}




6. Predict the output or error(s) for the following ?

#include<stdio.h>	
main()
{
printf("%p",main);
}




7. Predict the output or error(s) for the following ?

main()
{
clrscr();
}
clrscr();





8. Predict the output or error(s) for the following ?

enum colors {BLACK,BLUE,GREEN}
 main()
{
  
 printf("%d..%d..%d",BLACK,BLUE,GREEN);
   
 return(1);
}





9. Predict the output or error(s) for the following ?

void main()
{
 char far *farther,*farthest;
  
 printf("%d..%d",sizeof(farther),sizeof(farthest));
   
 }




10. Predict the output or error(s) for the following ?

#include<stdio.h>	
main()
{
 int i=400,j=300;
 printf("%d..%d");
}