C Programming - Control Instructions - Discussion

Discussion Forum : Control Instructions - Point Out Correct Statements (Q.No. 6)
6.
Which of the following statements are correct about the below C-program?
#include<stdio.h>
int main()
{
    int x = 10, y = 100%90, i;
    for(i=1; i<10; i++)
    if(x != y);
        printf("x = %d y = %d\n", x, y);
    return 0;
}
1 : The printf() function is called 10 times.
2 : The program will produce the output x = 10 y = 10
3 : The ; after the if(x!=y) will NOT produce an error.
4 : The program will not produce output.
1
2, 3
3, 4
4
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
70 comments Page 6 of 7.

Gopinath.nan said:   1 decade ago
What is the meaning of y=100%90 ?

Ravi said:   1 decade ago
Good explanation sai thanx a lot.

Shailendra said:   1 decade ago
Your concept is very clear Kavya

Gangadhar said:   1 decade ago
You absolutely correct kavya.

Sangeetha said:   1 decade ago
Correct explanation kavya.

Keerthana Sundaram said:   1 decade ago
Clear explanation. Thanks.

S.V.KISHORE said:   7 years ago
Good explanation @Kavya.
(1)

Karthik said:   1 decade ago
Good explanation kavya.

Siva said:   1 decade ago
Good explanation Kavya.

Munni said:   1 decade ago
Nice explanation kavya.


Post your comments here:

Your comments will be displayed after verification.