Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started