top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

C output question

0 votes
313 views

main()
{
int a=2;
printf("%d ",(++a)*(a+=2)* (a=5));
}

please give output , with explanation!!!

posted Aug 15, 2013 by Jai Ludhani

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

This code will not compile and give the following "error called object '++a' is not a function"
Don't know what you are trying to do, but avoid writing this type of tricky code which will give different output on different compiler.

answer Aug 15, 2013 by Deepak Dasgupta
Similar Questions
0 votes
#include<stdio.h>
int main()
{
   int n;
   for(n = 7; n!=0; n--)
     printf("n = %d", n--);
   getchar();
   return 0;
}
+2 votes
void main(){
   int i=320;
   char *ptr=(char *)&i;
   printf("%d",*ptr); 
}

Please provide your explanation also?

+3 votes
#include<stdio.h>

int main(){ 
 int s=2,*r=&s,**q=&r,***p=&q;

 printf("%d",p[0][0][0]);
 return 0;
}

Please provide the explanation of the answer also.

+3 votes

See the following code

void main(){
   float a=5.2;
  if(a==5.2)
     printf("Equal");
  else if(a<5.2)
     printf("Less than");
  else
     printf("Greater than"); 
}

Expected output is equal but we does not get same why?

...