Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

**C code please not C++** Complete the program so that it will print the desired results from the indicated comparisons. It will prompt the user

**C code please not C++**

Complete the program so that it will print the desired results from the indicated comparisons. It will prompt the user to enter an integer, a floating point number, and a character. Fill in each section to make the comparison and display the indicated result. For all outputs, add a newline after the specified result. Print exactly the responses shown in the starter file. (Copy and paste or modify the comment lines into code statements to be completely accurate.)

Do not change any of the other code statements in the starter program.

Key terms to use: if, else, fabs( )

Operators: > < >= <= == !=

#include #include

int main( ) { int an_int; //inputs double a_dbl; char a_char; //get inputs printf( "Enter an integer: " ); scanf( "%d", &an_int );

printf( "Enter a double: " ); scanf( "%lf", &a_dbl ); printf( "Enter a character: " ); scanf( " %c", &a_char ); printf( " " ); //Compare integer to 10 //print "Integer is greater than 10" if it's larger than 10, //otherwise print "Integer is 10 or less" //Test if integer is equal to 10 //print "Integer is equal to 10" if it is, otherwise print "Integer is not equal to 10" //Test if double is less than 98.6 //print "Double is less than 98.6" if it's less than 98.6, //othewise print "Double is 98.6 or greater" //Test if double is at least 98.6 //print "Double is 98.6 or greater" if it is greater than or equal to 98.6, //otherwise, print "Double is less than 98.6" //Test if double is 55.123, within an epsilon of 0.0001 //print "Double is equal to 55.123" if it is within the epsilon, //otherwise, print "Double is not equal to 55.123" //Test if the character is 'a'. //if so, print "It's a", //otherwise, print "Not a"

//Test if the character is 'A' or larger //if so, print "It's at least an A", //otherwise, do nothing 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

Step: 3

blur-text-image

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

8th Edition

013460153X, 978-0134601533

More Books

Students also viewed these Databases questions

Question

Propose a reasonable mechanism for the following reaction. OH

Answered: 1 week ago

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago