Banner Header

Wednesday, 30 August 2017

C Program Division Of Two Number

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

C Program Division Of Two Number Reviewed by Waqas Ahmed Mir PC on August 30, 2017 Rating: 5 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 variab...

No comments: