Times of the square of input number

Assignment Help Basic Computer Science
Reference no: EM132084977

I wrote this code

#include<stdio.h>

intmain() 

{

doublenumber,squared;

//prompts user for a number

printf("Enter a Number:n");

scanf("%lf",&number); 

squared=number*number; 

//Calculates the square of the number

printf("The square of inputted number is: %lf",squared);

return0;}

I got feedback after it was graded that I need to have a function call from main to a separate function that calculates the results and returns it to main. Could you please provide assistance.

how to make a function in C that accepts one input number and returns a double number. The themes for the functions should be one of the following:

  • Calculates 3.14 times of the square of input number. For example, if 2 is input then 12.56 should be returned. (e.g. 3.14*2*2 = 12.56)
  • Divides the number by 3 and returns the result. For example, if 6 was input then 2.0 should be returned.
  • Squares the number and returns the result. For example, if 12.1 was entered then 146.41 would be returned.

Reference no: EM132084977

Questions Cloud

Discuss what actions you could take to navigate the issue : In the profession of an Industrial Organization (I/O) psychologist, discuss an ethical issue you are likely to encounter. Some suggested considerations.
Configuring name resolution : You are the administrator of the Contoso Corporation. You try to connect to an internal website while another user connects to the website.
Configuring wireless connections : You have a mobile computer that is used for troubleshooting. You want it to automatically connect to wireless connections at the main office
How would switching to a real-time database solution : How would switching to a real-time database solution help Falcon Security remain competitive?
Times of the square of input number : I got feedback after it was graded that I need to have a function call from main to a separate function that calculates the results and returns it to main.
Summarize the four components of profound knowledge : Summarize the four components of Profound Knowledge. How do they mutually support each other?
Research bastion hosts on the internet : Research bastion hosts on the Internet. Find one tip or suggestion and describe it.
Poor estimate of activity resources on project outcomes : When do people experience the impact of a poor estimate of activity resources on project outcomes?
Give example of enhancer of great groups : From this week's assigned readings from Ledlow & Coppola (2014), list a 'killer' and give an example of an 'enhancer' of great groups.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd