Podcast
Questions and Answers
Which of the following while or do/while statements are valid in ANSI C and Betty-compliant?
Which of the following while or do/while statements are valid in ANSI C and Betty-compliant?
- a = 0; do { printf("%d\n", a); a++; } while (a < b); (correct)
- a = 0; while (a < b) ( printf("%d\n", a); a++; )
- a = 0; while (a = 0; a < b; a++) { printf("%d\n", a); }
- a = 0; while (a < b) printf("%d\n", a++);
Which of the following while or do/while statements are invalid in ANSI C and Betty-compliant?
Which of the following while or do/while statements are invalid in ANSI C and Betty-compliant?
- a = 0; while (a = 0; a < b; a++) { printf("%d\n", a); } (correct)
- a = 0; do { printf("%d\n", a); a++; } while (a < b);
- a = 0; while (a < b) ( printf("%d\n", a); a++; )
- a = 0; while (a < b) printf("%d\n", a++);
Which of the following while or do/while statements will print the values of 'a' while 'a' is less than 'b' in ANSI C and Betty-compliant?
Which of the following while or do/while statements will print the values of 'a' while 'a' is less than 'b' in ANSI C and Betty-compliant?
- a = 0; while (a < b) ( printf("%d\n", a); a++; ) (correct)
- a = 0; while (a = 0; a < b; a++) { printf("%d\n", a); }
- a = 0; while (a < b) printf("%d\n", a++);
- a = 0; do { printf("%d\n", a); a++; } while (a < b);
Flashcards are hidden until you start studying