Question PRG-C-0023
EasyWhat is the output of this program?
#include <stdio.h>
int main() {
printf("%d", 10 % 4);
return 0;
}
- A.
2
- B.
4
- C.
Show answer and explanation
Answer: A
% gives the remainder: 10 = 4 × 2 + 2.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
C question
What is the output of this program?
#include <stdio.h>
int main() {
printf("%d", 10 % 4);
return 0;
}
2
4
Answer: A
% gives the remainder: 10 = 4 × 2 + 2.
2.5
0