what is the output of below
int n=10;
(n++)++;
printf("%d",n);
Answers were Sorted based on User's Feedback
Answer / kirankumaryakkala
ans. error:Lvalue required
why? Lvalue means leftside assignment value,
here, first it goes to increment on N, again it is going to
increment, before going to increment second time, you should
allocate one varibale that holds the first time increment
value, other wise from where to it increment...
Is This Answer Correct ? | 11 Yes | 1 No |
Answer / deepak kumar
error : lvalue required.
n++ return 10 and after that n will increase to 1.
so now n=11
but next operation (postfix operator) is performing on
constant value 10 which is returned by (n++) operation.
it actually try to assign 11 to constant value 10. it is not
possible .
firstly we have to store it in a variable and then increment
can take place..
Is This Answer Correct ? | 9 Yes | 2 No |
Tell me a C program to display the following Output? 1 1 1 1 1 2 2 2 2 3 3 3 4 4 5
1 232 34543 4567654 can anyone tell me how to slove this c question
Why static variable is used in c?
what does ‘#include’ mean?
what is foreign key in c language?
Write a c program to read a positive number and display it in words.? ex: 123=one two three help me....
Write a program to find the number of times that a given word(i.e. a short string) occurs in a sentence (i.e. a long string!). Read data from standard input. The first line is a single word, which is followed by general text on the second line. Read both up to a newline character, and insert a terminating null before processing. Typical output should be: The word is "the". The sentence is "the cat sat on the mat". The word occurs 2 times.
Explain what is the difference between the expression '++a' and 'a++'?
How to reverse a string using a recursive function, without swapping or using an extra memory?
31 Answers Cisco, Mind Tree, Motorola, Ophio, Sony, TCS, Wipro,
What is volatile
Write a program which take a integer from user and tell whether the given variable is squar of some number or not. eg: is this number is 1,4,9,16... or not
Why array starts with index 0