C Program to Div Two Numbers

In this program, user is asked to enter two integers. Then, the Div of those two integers is stored in a variable and displayed on the screen.

div of two number in c


Program to Div Two Integers

#include <stdio.h>
#include <conio.h>
int main()
{
    int firstNumber, secondNumber, divOfTwoNumbers;
   
    printf("Enter two integers: ");

    // Two integers entered by user is stored using scanf() function
    scanf("%d %d", &firstNumber, &secondNumber);

    // div of two numbers in stored in variable divOfTwoNumbers
    divOfTwoNumbers = firstNumber * secondNumber;

    // Displays div     
    printf("%d / %d = %d", firstNumber, secondNumber, divOfTwoNumbers);

getch();
}


Output
Enter two integers: 1736
14
1736 / 14 = 124
In this program, user is asked to enter two integers. Two integers entered by the user is stored in variables firstNumber and secondNumber respectively. This is done using scanf()function.
Then, variables firstNumber and secondNumber are subtracting using - operator and the result is stored in divOfTwoNumbers.





Finally, the divofTwoNumbers is displayed on the screen using printf() function.


Click on the download button to download file

download button

Post a Comment

Thanks For Your Comment. We will reply you as soon as possible ...

 
COOL PROGRAMMING 4 U © 2013. All Rights Reserved. Shared by Cp4U
Top