¦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 |
#include<stdio.h> main() { register i=5; char j[]= "hello"; printf("%s %d",j,i); }
#define DIM( array, type) sizeof(array)/sizeof(type) main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr, int)); }
Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?
respected sir, i did my MCA in 2013 when i am going to attend to an interview i was asked about my project how will i explain my project could please help me in this and my project title is "Social Networking Site For Social Responsibility"
write a program in c language to get the value of arroy keys pressed and display the message which arrow key is pressed?
What is the output of the program given below main() { signed char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
void main() { char ch; for(ch=0;ch<=127;ch++) printf(“%c %d \n“, ch, ch); }
What is the subtle error in the following code segment? void fun(int n, int arr[]) { int *p=0; int i=0; while(i++<n) p = &arr[i]; *p = 0; }
enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",BLACK,BLUE,GREEN); return(1); }
print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!
How can u say that a given point is in a triangle? 1. with the co-ordinates of the 3 vertices specified. 2. with only the co-ordinates of the top vertex given.
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.