Q.4 WAP in C/ C++/ java to divide two integers (dividend and divisor)
Example,
Dividend = 7
Divisor = 2
Result = 3
Dividend = -17
Divisor = 5
Result = -3
Solution :
#include<stdio.h>
void main()
{
int a,b;
printf("\nDividend = ");
scanf("%d", &a);
printf("Divisor = ");
scanf("%d", &b);
printf("Result : %d\n", a/b);
} // end of main()
Comments
Post a Comment