CJCoding With Joseph
15per day
← Back to Question List
C Code Walkthrough #1

Integer Division Truncation

easyPrinting

📄 Code

Read carefully — what does this print?
1#include <stdio.h>
2 
3int main() {
4 int a = 7;
5 int b = 2;
6 int result = a / b;
7 printf("%d\n", result);
8 printf("%.2f\n", (float)a / b);
9 return 0;
10}

🎯 Your Answer

Next →