Can someone help me in the conversation from km to m? In Program c | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

Can someone help me in the conversation from km to m? In Program c

Plis

15th Jul 2021, 4:58 AM
kevin josuĆØ mondragon nuƱez
9 Respostas
+ 2
Hello kevin josuĆØ mondragon nuƱez can you link the code having the error(s) if possible?
15th Jul 2021, 5:14 AM
Rohit
+ 3
1 km = 1000 m So, 5 km = 5 * 1000 = 5000 m Now it's your turn to convert this into codes. šŸŒø
15th Jul 2021, 5:01 AM
Rohit
+ 1
//kevin josuĆØ mondragon nuƱez //You're using turbo C which is deprecated i think. /*convierte kilometros a metros*/ #include <stdio.h> int main() { float s,m; printf("dame los kilometros a convertir:"); scanf("%f",&s); m = s*1000; printf("\nla cantidad de metros son:%f", m); }
15th Jul 2021, 5:27 AM
Rohit
+ 1
Thank you very much, I thank you now if you copied me
15th Jul 2021, 5:30 AM
kevin josuĆØ mondragon nuƱez
+ 1
getch use karo
16th Jul 2021, 10:39 AM
Ankit Kumar
Ankit Kumar - avatar
0
The normal convention if I understand, when passing it to code it does not compile me an error in one line
15th Jul 2021, 5:12 AM
kevin josuĆØ mondragon nuƱez
0
/*convierte kilometros a metros*/ #include #include main() { float s,m; clrscr(); printf("dame los kilometros a convertir:"); scanf("%f",&s); m = s*1000; printf("la cantidad de metros son:%f", m); getche(); }
15th Jul 2021, 5:21 AM
kevin josuĆØ mondragon nuƱez
0
This is the Program and it gives me errors
15th Jul 2021, 5:22 AM
kevin josuĆØ mondragon nuƱez
0
// converting km to m #include<stdio.h> int main(){ // declaring variables float km; float m; printf("Enter the distance in kilometers:\n"); //input promt scanf("%f",&km); // input m = km * 1000; // converting km to main printf("The distance in kilometers is %.2f meters.",m); // output return 0; }
16th Jul 2021, 10:37 PM
Aashutosh Swami
Aashutosh Swami - avatar