Program to divide two integers in C

Source Code

// 4.i. Program to divide two integers
// Arpan Das - CST 2nd Year (VOCLET)

#include 
//#include 
#include 

void main () {
	int x, y;
	//clrscr();
	//system("cls");
	
	printf("\t\t..:: Integer division ::..\n\n");
	printf("Please enter values for dividend and divider respectively: ");
	scanf("%d%d", &x, &y);
	printf("\nDivision: %d / %d = %d", x, y, x/y);
	
	//getch();
}

Output

		..:: Integer division ::..

Please enter values for dividend and divider respectively: 15 3

Division: 15 / 3 = 5

Leave a Reply

Note: Your email address will not be published. Required fields are marked *