Question

Write a function named squareIt() that computes the square of the value passed to it and...

Write a function named squareIt() that computes the square of the value passed to it and displays the result. The function should be capable of squaring numbers with decimal points. b. Include the function written in Exercise 4a in a working program. Make sure your function is called from main(). Test the function by passing various data to it. in C code please

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code

#include<stdio.h>

void squareIt(float);

int main()
{
   float num;
   printf("Enter the number to find its square: ");
   scanf_s("%f", &num);
   squareIt(num);
   getch();
   return 1;
}
void squareIt(float num)
{
   float square;
   square = num * num;
   printf("Square of the %.2f is %.2f\n\n", num, square);
}

outputs

If you have any query regarding the code please ask me in the comment i am here for help you. Please do not direct thumbs down just ask if you have any query. And if you like my work then please appreciates with up vote. Thank You.

Add a comment
Know the answer?
Add Answer to:
Write a function named squareIt() that computes the square of the value passed to it and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT