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
How do I send escape sequences to control a terminal or other device?
a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if
What is the basic structure of c?
Why is sizeof () an operator and not a function?
What is nested structure?
the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none
how many key words availabel in c a) 28 b) 31 c) 32
What is the difference between c and python?
a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f
application attempts to perform an operation?
What is data structure in c language?
What is structure data type in c?
Why do we use stdio h and conio h?
Why is c called c?
string reverse using recursion