#include <stdio.h>
#include <stdlib.h>
int main()
{
float in_cm;
char in_inches[4];
printf("Convert inches: ");
scanf_s("%s", &in_inches);
in_cm = atoi(in_inches)*2.54;
printf("%.2f cmn", in_cm);
return(0);
}
I am testing out this code and when i input a value to the command prompt to Convert Inches:
When i press "enter" in my keyboard the command prompt closes, can anybody help?
I am doing C.