+ 4

[solved]C programming

A C Program that promts the user to enter the radius of a circle in meters & computes the area of a circle.The program then uses a function to convert the area into square kilometres (KM)ยฒ the program display the area in kilometres squared. Hint 1Kmยฒ = 1000000mยฒ https://code.sololearn.com/cUf3EDVAC52V/?ref=app

18th Mar 2022, 1:35 PM
๐“‚๐’ถ๐“‡๐“‰๐’พ๐“ƒ๐“€๐’พ๐“‚
๐“‚๐’ถ๐“‡๐“‰๐’พ๐“ƒ๐“€๐’พ๐“‚ - avatar
7 Answers
+ 2
printf("The area of the circle is : %.3f kmยฒ" ,result/1000000.0 ); //you know %f gives a float, the .3 makes it print only 3 places after the decimal point. {Edit: A bit of housekeeping. If this is a success, you can be a champion ๐Ÿฅ‡ of the Q&A forum if you edit your original post to start with [Solved]}
19th Mar 2022, 12:59 AM
HungryTradie
HungryTradie - avatar
+ 4
Lemme try then you help me out โ˜บ๏ธ
18th Mar 2022, 8:18 PM
๐“‚๐’ถ๐“‡๐“‰๐’พ๐“ƒ๐“€๐’พ๐“‚
๐“‚๐’ถ๐“‡๐“‰๐’พ๐“ƒ๐“€๐’พ๐“‚ - avatar
+ 3
#include <stdio.h> float aoc(float ); int main() { float r,result; printf ("Enter radius of a circle in meters : \n"); scanf("%f",&r); result = aoc(r); printf("The area of the circle is :%f" ,result ); return 0; } float aoc(float q) { float area , pi; pi=3.14; area= pi*q*q; return area ; }
18th Mar 2022, 10:52 PM
๐“‚๐’ถ๐“‡๐“‰๐’พ๐“ƒ๐“€๐’พ๐“‚
๐“‚๐’ถ๐“‡๐“‰๐’พ๐“ƒ๐“€๐’พ๐“‚ - avatar
+ 2
Is this homework? The q&a is not for us writing code for you. We help you fix code you already have.
18th Mar 2022, 2:04 PM
Brain & Bones
Brain & Bones - avatar
+ 2
I can't figure out how to incorporate the conversation of meters to kmยฒ๐Ÿ˜ฅ
18th Mar 2022, 10:54 PM
๐“‚๐’ถ๐“‡๐“‰๐’พ๐“ƒ๐“€๐’พ๐“‚
๐“‚๐’ถ๐“‡๐“‰๐’พ๐“ƒ๐“€๐’พ๐“‚ - avatar
+ 2
G'day Martinkim could you copy+paste that code into a SoloLearn "code bit" then edit that post to have a link to your code bit instead of the code in the text. Much much easier for us to help you.... https://www.sololearn.com/discuss/333866/?ref=app
18th Mar 2022, 10:56 PM
HungryTradie
HungryTradie - avatar
+ 1
I did the homework ๐Ÿ”จ, can I send it to your teacher ๐Ÿค“, will I be 1st in class๐Ÿฅ‡?
18th Mar 2022, 7:52 PM
HungryTradie
HungryTradie - avatar