wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Consider the following C statements :

S1: int c = a + b;
S2: for (a, b, c);
S3: While (a,b);

Which of the above statements will give syntax error?

A
None of the above
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
Only S2
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
C
Only S1 and S3
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
Only S3
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is B Only S2
S1: for c = a + b this is syntactically correct.

S2: for (a,b,c) this is not correct. The correct syntax of for loop is for (a; b; c)

S3: While (a,b) this is correct because While (a,b) can be a function having a and b as its parameter.

So option (b) is correct.

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Graphical Interpretation of Continuity
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon