Computer Science, asked by nani234, 1 year ago

write a c program to find product and quotient of any two numbers

Answers

Answered by kshitijisgreat
4
Hi friend

C PROGRAM TO FIND PRODUCT=>

#include
#include

int main() {
int num, temp;
long productOfDigit = 1;

/*
* Take a number as input from user
*/
printf("Enter a Number\n");
scanf("%d", &num);
temp = num;

while(num != 0){
/* get the least significant digit(last digit)
of number and multiply it to productofDigit */
productOfDigit *= num % 10;
/* remove least significant digit(last digit)
form number */
num = num/10;
}

printf("Product of digits of %d = %ld", temp, productOfDigit);

getch();
return 0;
}

C PROGRAMM TO FIND QUOTIENT=>
#includeint main(){int dividend, divisor, quotient, remainder;

printf("Enter dividend: ");
scanf("%d",&dividend);

printf("Enter divisor: ");
scanf("%d",&divisor);// Computes quotient
quotient = dividend / divisor;// Computes remainder
remainder = dividend % divisor;

printf("Quotient = %d\n", quotient);
printf("Remainder = %d", remainder);return0;}

_________××××___________

HOPE IT HELPS

PLZ MQRK IT AS BRAINLLEST

nani234: but both in 1
Similar questions