Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

design a simple disciplinary and grievance procedure.

Answered: 1 week ago