522 views
0 votes
0 votes

the given ans is (d) but it will run forever as ch is character type and can have max value 255 and then it will be reset. also char would be implicitly typecasted to int so comparison is valid. why would it give compilation error

1 Answer

Best answer
4 votes
4 votes

Semicolon after 'char ch = 1' Is missing.

selected by

Related questions

0 votes
0 votes
0 answers
1
`JEET asked Dec 8, 2018
275 views
#include <stdio.h int atoi(char s[]) { int i, n; n = 0; for(i = 0; s[i] >= '0' && s[i] <= '9'; ++i) n = 10*n + (s[i] - '0'); return n; } int main() { char s[] = "jitendra...
1 votes
1 votes
1 answer
2
. asked Apr 2, 2017
1,529 views
What will be the output of the following C program? If you think it will give a runtime error, you need to mention it. In either case,your answer must include proper just...
0 votes
0 votes
0 answers
4
rahul sharma 5 asked Oct 13, 2017
1,312 views
Find the C statement which has a syntax error.fi(z);for(a, b, c);whil(a, b);fi (z);for (a, b, c);whil (a, b);None of these.This is a modification of https://gateoverflow....