+ 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 Respostas
+ 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