+ 2
Can someone help me in the conversation from km to m? In Program c
Plis
9 Antworten
+ 2
Hello kevin josuè mondragon nuñez can you link the code having the error(s) if possible?
+ 3
1 km = 1000 m
So, 5 km = 5 * 1000 = 5000 m
Now it's your turn to convert this into codes. 🌸
+ 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);
}
+ 1
Thank you very much, I thank you now if you copied me
+ 1
getch use karo
0
The normal convention if I understand, when passing it to code it does not compile me an error in one line
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();
}
0
This is the Program and it gives me errors
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;
}