Sure!
Here's a smaller, simpler C program that still combines basic I/O, variables, and arithmetic
operators:
#include <stdio.h>
int main() {
int a, b;
// Welcome message
printf("Simple C Program Demo\n\n");
// Input two integers
printf("Enter first integer: ");
scanf("%d", &a);
printf("Enter second integer: ");
scanf("%d", &b);
// Display arithmetic operations
printf("\nResults:\n");
printf("%d + %d = %d\n", a, b, a + b);
printf("%d - %d = %d\n", a, b, a - b);
printf("%d * %d = %d\n", a, b, a * b);
if (b != 0) {
printf("%d / %d = %.2f\n", a, b, (float)a / b);
printf("%d %% %d = %d\n", a, b, a % b); // modulo operator
} else {
printf("Division and modulo by zero is not allowed.\n");
return 0;
✅ This small program:
Takes two integer inputs
Performs all basic arithmetic operations
Handles division by zero safely
Uses printf formatting for clarity
---
If you want, I can make an even smaller version that also shows relational and logical operators so it
becomes a full “operators demo” in under 30 lines. Do you want me to do that?