C Programming :: Basic Concepts - Discussion
Home > C Programming > Basic Concepts > MCQs Questions Discussion
8 / 90
What will be the output of the below C program.
#include<stdio.h>
int main()
{
int i=-1;
-i;
printf("i = %d, -i = %d \n",i,-i);
return 0;
}
#include<stdio.h>
int main()
{
int i=-1;
-i;
printf("i = %d, -i = %d \n",i,-i);
return 0;
}
Ai = -1, -i = 1
Bi = 1, -i = 1
Ci = -1, -i = -1
DComilation error
ENone of these
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
STEP-BY-STEP
In line no 4, variable i is initialized with -1.
Line no. 5 is basically of no use, you may delete it if you like, it will work the same.
In the next line it will print i=-1 and -i=-(-1), which is equal to 1.
So, the output will be i = -1, -i = 1.
Read Full Answer
Report Error
Please Login First Click Here