C Programming :: Declarations and Initializations - Discussion
6 / 54
#include<stdio.h>
void main() {
int x = 10,y = 10, z = 5, i;
i = x;
printf("%d",i==x);
}
#include<stdio.h>
void main() {
int x = 10,y = 10, z = 5, i;
i = x;
printf("%d",i==x);
}
A1
BError
C0
D5
Show Explanation
The value of x initialised is 10. Also i=x so i=10. Now when comparing condition (i==x) it will give boolean result that is if the condition is true it will return 1 else it will return 0. So here the condition is true coz x=i hence output is 1.
Asked In ::
The value of x initialised is 10. Also i=x so i=10. Now when comparing condition (i==x) it will give boolean result that is if the condition is true it will return 1 else it will return 0. So here the condition is true coz x=i hence output is 1.
Read Full Answer
Report Error
Please Login First Click Here
The value of x initialised is 10. Also i=x so i=10. Now when comparing condition (i==x) it will give boolean result that is if the condition is true it will return 1 else it will return 0. So here the condition is true coz x=i hence output is 1.
Read Full Answer
Report Error
Please Login First Click Here
The output to this program will be 1. I line 3, x is initialized with the value 10, and in the next line i is initialized with value of x (i=x). So both i and x contain the value 10. In line 5, we are printing (i==x) i.e., a boolean result by comparing both the values of i and x, checking whether their values are equal or not. In C, there are 2 situations for a boolean operation i.e., if condition is satisfied or true then result is 1, else it is 0. Here the condition is true.
Read Full Answer
Report Error
Please Login First Click Here