C Program : Simple Division Example

 #include <stdio.h>

int main() { int dividend, divisor; float quotient; printf("Enter the dividend: "); scanf("%d", &dividend); printf("Enter the divisor: "); scanf("%d", &divisor); if (divisor != 0) { quotient = (float)dividend / divisor; printf("Result of %d divided by %d is %.2f\n", dividend, divisor, quotient); } else { printf("Division by zero is not allowed.\n"); } return 0; }

Comments

Popular posts from this blog

Video Formats

Where video editing is used

File saving and folder management