write a programme to enter two numbers. Divide the first number by the second number and print the result, only if the second number is not zero
Answers
Answered by
0
Answer:
#include <stdio.h>
#include <math.h>
int main()
{
int a, b;
float div;
printf("Enter the value of a:\n");
scanf ("%d", & a);
printf("Enter the value of b:\n");
scanf ("%d", & b);
div=(float)a/b;
if(b!=0 ){
printf("Division of %d / %d is %.2f \n", a, b,div);
}
if(b==0 ){
printf("Division by 0 not possible");
}
return 0;
}
Similar questions
Math,
1 month ago
Sociology,
1 month ago
Math,
2 months ago
Physics,
2 months ago
Social Sciences,
10 months ago
Math,
10 months ago
Computer Science,
10 months ago