Give the logic for this
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a=10,b;
b=++a + ++a;
printf("%d", b);
getch();
}
Output: 24......How?
Answer Posted / suman halder
++a is an unary expression which signifies pre-increment operation...so ,pre-increment will be evaluated before the binary operation takes place..
b=++a + ++a;
here,a will be incremented twice and then binary operation is performed...
so,
b=12+12 which produces 24...
| Is This Answer Correct ? | 6 Yes | 3 No |
Post New Answer View All Answers
What do you mean by a sequential access file?
The __________ attribute is used to announce variables based on definitions of columns in a table?
What is the meaning of typedef struct in c?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
What is the right way to use errno?
How do you define CONSTANT in C?
difference between object file and executable file
Can a pointer point to null?
How can you tell whether two strings are the same?
What does main () mean in c?
Do you know pointer in c?
What does c value mean?
List the variables are used for writing doubly linked list program.
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
What is else if ladder?