¦void main()
¦{
¦int i=10,j;
¦ j=i+++i+++i;
¦printf("%d",j);
¦getch();
¦}
¦ output:-30
but in same question if we write as-
¦void main()
¦{
¦int i=10;
¦ int j=i+++i+++i;
¦printf("%d",j);
¦getch();
¦}
¦ output:-33
why output is changed from 30 to 33. Can any body answer...
Answers were Sorted based on User's Feedback
ithink cannot use void in main().becoz returns integer. and output of this 2 program is 30 only.not print 33
Is This Answer Correct ? | 2 Yes | 3 No |
Answer / abhishek kumar
this question is itself is confusing question as if we
compile it with c,c++ compiler, the compiler itself get
confuse and it take i=10 all time as it does not make
distinguish between operator in expression(i+++i+++i) and
give output as 30, but if we compile it with java compiler
it output is 33, as java compiler make distinguish between
operator as (i++ +i+ ++i).
so my conclusion is that question given above is confusing
itself that why output are varying every time.
Is This Answer Correct ? | 1 Yes | 3 No |
write a program to count the number the same (letter/character foreg: 's') in a given sentence.
print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!
void main() { int i=10, j=2; int *ip= &i, *jp = &j; int k = *ip/*jp; printf(ā%dā,k); }
main() { clrscr(); } clrscr();
Write a routine to implement the polymarker function
const int perplexed = 2; #define perplexed 3 main() { #ifdef perplexed #undef perplexed #define perplexed 4 #endif printf("%d",perplexed); } a. 0 b. 2 c. 4 d. none of the above
Print an integer using only putchar. Try doing it without using extra storage.
How we print the table of 3 using for loop in c programing?
struct aaa{ struct aaa *prev; int i; struct aaa *next; }; main() { struct aaa abc,def,ghi,jkl; int x=100; abc.i=0;abc.prev=&jkl; abc.next=&def; def.i=1;def.prev=&abc;def.next=&ghi; ghi.i=2;ghi.prev=&def; ghi.next=&jkl; jkl.i=3;jkl.prev=&ghi;jkl.next=&abc; x=abc.next->next->prev->next->i; printf("%d",x); }
struct Foo { char *pName; char *pAddress; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); obj->pName = malloc(100); obj->pAddress = malloc(100); strcpy(obj->pName,"Your Name"); strcpy(obj->pAddress, "Your Address"); free(obj); printf("%s", obj->pName); printf("%s", obj->pAddress); } a. Your Name, Your Address b. Your Address, Your Address c. Your Name Your Name d. None of the above
main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }
how can i search an element in an array
2 Answers CTS, Microsoft, ViPrak,