I'm following an introductory tutorial to C programming. It told me to write a simple program that converts degree Celsius to Fahrenheit.
I wrote the code as it was shown in the video but it only prints the first line and then gets stuck.
I don't understand what's wrong with my program:
#include <stdio.h>
//program to convert Celsius to Fahrenheit
int main()
{
int c;
int f;
printf("Enter the temperature in Celsius:");
scanf("%d\n", &c);
f=9*c/5 + 32;
printf("The temperature in Fahrenheit is: %d\n",f);
return 0;
}
I have recently started using Ubuntu and am using Code Block for building the program with gcc as the compiler.
Please help Thank You;