Use C code please!
Write the function definition for a function called FindQuo that takes one argument of type double (arg1 ) and returns a double. The purpose of the function is to calculate the quotient of arg1 divided by a double (num) that will be entered by the user.
Inside the function declare ask and get a double value from the user called num
Use a loop (while or do/while) to ensure that the user does not enter a 0.0.
You do not want to divide by 0.
Divide arg1 by num and return the result
#include<stdio.h> double FindQuo(double arg1){ double num; printf("Enter value for num: "); scanf("%lf",&num); while(num==0.0){ printf("Enter value for num: "); scanf("%lf",&num); } if(arg1>=0 && num>0){ printf("the result is positive\n"); } if(arg1<0 && num<0){ printf("the result is positive\n"); } if(arg1<0 && num>0){ printf("the result is negative\n"); } if(arg1>=0 && num<0){ printf("the result is negative\n"); } return arg1/num; } int main(){ printf("%lf",FindQuo(5)); return 0; }
Get Answers For Free
Most questions answered within 1 hours.