Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C programming only please It wont help to use loop It doesnt need have to be very professional, it can be basic. Write a program

C programming only please
It wont help to use loop
It doesnt need have to be very professional, it can be basic.
image text in transcribed
Write a program that will read in 4 numbers of datatype double from the user and store into 4 separate variables. The program should test each number to see if it is a perfect square (which means that the squareroot of that number is a whole number) The program should have a pointer to an double that, at the end, will point to the largest perfect square of the 4 entered into the program. The program should only point to a variable, if that variable is 1) a perfect square and 2) if the number that the pointer is pointing to is smaller than the current number (or if the pointer is pointing at nothing) The program should print out the largest perfect square to the screen. HINT # 1: if a pointer hasn't had anything assigned to it yet, then it's empty. So a pointer(let's call it pnum), is empty if: pnumNULL HINT #2: you'll need to use the floor() library function. The floor function just cuts off the decimal portion of a double eaving the integer piece. floor(5.603) will be equal to 5. So if num is a perfect square, then: sqrt(num)-floorfsqrt(num)) HINT #3: this program will NOT use any loops at all. Later, once we cover arrays, we could do this in a loop or two, but with what we know, you just have to read in each number into a separate variable. Test your program with the following: 16 27 369

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

Seven NoSQL Databases In A Week Get Up And Running With The Fundamentals And Functionalities Of Seven Of The Most Popular NoSQL Databases

Authors: Aaron Ploetz ,Devram Kandhare ,Sudarshan Kadambi ,Xun Wu

1st Edition

1787288862, 978-1787288867

More Books

Students also viewed these Databases questions