Podcast
Questions and Answers
What is the output of the following code snippet?
int main() {
int a = 5;
printf("%d", a++);
printf("%d", ++a);
return 0;
}
What is the output of the following code snippet? int main() { int a = 5; printf("%d", a++); printf("%d", ++a); return 0; }
- 56
- 57
- 66
- 67 (correct)
Which of the following is NOT a valid data type in C language?
Which of the following is NOT a valid data type in C language?
- float
- char
- double
- string (correct)
What is the difference between a while loop and a do-while loop in C language?
What is the difference between a while loop and a do-while loop in C language?
- A while loop can only be used for numerical iteration, while a do-while loop can be used for any kind of iteration
- A do-while loop is executed at least once, while a while loop may not be executed at all (correct)
- A while loop is executed at least once, while a do-while loop may not be executed at all
- There is no difference, they are interchangeable