1. What will be the output of the program? #include<stdio.h> int main() { int x = 3; float y = 3.0; if(x == y) printf("x and y are equal"); else printf("x and y are not equal"); return 0; }
Ask Your Doubts Here
Comments
By: guest on 01 Jun 2017 06.01 pm
Step 1: int x = 3; here variable x is an integer type and initialized to '3'. Step 2: float y = 3.0; here variable y is an float type and initialized to '3.0' Step 3: if(x == y) here we are comparing if(3 == 3.0) hence this condition is satisfied. Hence it prints "x and y are equal".
Step 2: float y = 3.0; here variable y is an float type and initialized to '3.0'
Step 3: if(x == y) here we are comparing if(3 == 3.0) hence this condition is satisfied.
Hence it prints "x and y are equal".