retagged by
1,073 views
2 votes
2 votes

what is the o/p
 

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


also suggest me notes so i can clear my concept about printf function (For Gate)

retagged by

6 Answers

–1 votes
–1 votes
In your question there are following operator are used..
Post increment operator:-.  eg...a++ (aplusplus)that means it first use the value then after increase it by 1and use it..so a=5
So,*******""first output is 5
Pre increment operator:- eg.++a (plusplus a) that means it first increase the value by 1 and after then use..above a store the value 6 then
So,******""second output is 7
Pre decrement operator:- eg.--a(minus minus a) that means it first decrease the value by 1 and after then use.above a store 7
Then
So,******""Third output is 6
edited by

Related questions

3 votes
3 votes
1 answer
1
5 votes
5 votes
3 answers
2
suvasish pal asked Aug 26, 2017
604 views
Will it result in to an error if a header file is included twice?[A].Yes[B].No[C].It is compiler dependent
1 votes
1 votes
1 answer
3
Vasu Srivastava asked Aug 18, 2017
1,021 views
#include <stdio.h int main(void){ int i=511; char *p = (char *)&i; printf("%d", *p); }OK so why take 2's complement and not simple binary number? Means, why is C giving -...
2 votes
2 votes
1 answer
4
Sugumaran asked Feb 7, 2018
483 views
#include<stdio.h int main() { int x=191; char *p; p=(char*)&x; printf("%d",*p); }explain it