Decode School

Decode School - The School for Problem Solvers

Welcome to my blog. Subscribe and get my latest blog post in your inbox.

C Program to divide two numbers

Get two integer numbers, divide both the integers and display the quotient.

Sample Input 1:

6 5 

Sample Output 1:


Sample Input 2:

28 4

Sample Output 2:


Program or Solution

//Program to division of two numbers
int main()
	int num1,num2,quotient;
	printf("Enter two numbers:");
	scanf("%d %d",&num1,&num2);
	printf("Quotient: %d",quotient);
	return  0;

Program Explanation

Get two integers a and b (using scanf statement) divide a by b, then store quotient in c (c=a/b, Note "/" operator gives quotient) print the value of c (using printf statement)