What will be the output of the following program
#include<stdio.h>
void main()
{
int i=20;
i-=i+++++i++;
printf("%d",i);
}
Answers were Sorted based on User's Feedback
Answer / suji
THE PROGRAM DOES NOT RETURN ANY THING.. IT WILL SHOW THE ERROR
| Is This Answer Correct ? | 10 Yes | 2 No |
Answer / shajitha
Answer will be 42.
i++ =20
i+++=20+
i+++++i=20+22
i+++++i++=42
| Is This Answer Correct ? | 7 Yes | 6 No |
Answer / j mahesh
i=20
i++ + ++i =20 + 21=41
i-=41
i=i-41 =20-41
i= -21
| Is This Answer Correct ? | 4 Yes | 4 No |
Answer / anil kumar singh
this program depend on compiler dos turbo3 cpp
error msg:Lvalue required
| Is This Answer Correct ? | 0 Yes | 1 No |
Find Index of least significant bit set in an Integer. ex. int value is say 10001000 results should be 4.
write a code for large nos multilication (upto 200 digits)
#include<stdio.h> #include<conio.h> void main() { clrscr(); int a=0,b=0,c=0; printf("enter value of a,b"); scanf(" %d %d",a,b); c=a+b; printf("sum is %d",c); getch(); }
What is variable declaration and definition in c?
How do we make a global variable accessible across files? Explain the extern keyword?
What is variable initialization and why is it important?
what's the o/p int main(int n, char *argv[]) { char *s= *++argv; puts(s); exit(0); }
Write a program to show the workingof auto variable.
What is the difference between int and float?
What are register variables in c?
Explain what is the stack?
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]