Question: 1. Write a C-program that reads two real numbers (a and b) from the keyboard and returns a/b. If 0 is entered for b, write

 1. Write a C-program that reads two real numbers (a andb) from the keyboard and returns a/b. If 0 is entered for

1. Write a C-program that reads two real numbers (a and b) from the keyboard and returns a/b. If 0 is entered for b, write a warning message and request a new value for b. INTER... Declare a and b Select the type corresponding to real numbers Printf and scanf to assign the values to a and b Control statement to check that b is not 0 !=0 returns a/b =0 : warning message and request a new value for b PLAN.... Include your stdio.h Main function Float or double a and b Printf and scanf to assign the values to a and b printf("Enter a number = "); scanf("%f,&a); printf("Enter a number = "); scanf("\%f", \&b); Control statement to check that b is not 0 if (b==0.0) \{printf: warning message and (figure out what ctrl statement )request a new value for b} !=0returnsa/b=0: Sample program: \#include int main() \{ float a; printf("Enter a number = "); scanf(" %f,&a); if (a==0.0) printf("You entered 0.ln"); else printf("You entered a number other than 0.ln "); return 0 ; \}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!