Skip to main content

How To Write Program To Divide Two Numbers In C | Programming In C

Divide Two Numbers in C

Divide Two Numbers in C

This program prompts the user to enter two numbers and divides them.


#include <stdio.h>

int main()
{
    int x, y;
    printf("Enter the value of x\\n");
    scanf("%d", &x);

    printf("Enter the value of y\\n");
    scanf("%d", &y);

    printf("The result is %d\\n", x / y);
    return 0;
}
        

Comments