hello everyone.
couple of days back i started learning C (with the help of internet)
i have do while loop which i can't get to work
as long as i know, when i press 'y' it should again ask temperature. but it is not doing that.
i am using Turbo C++ IDE
please check...
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
main ()
{
int temp;
float cel;
char repeat;
clrscr();
do
{
printf ("Enter the temperature:");
scanf ("%d",temp);
cel=(5.0/9.0)*(temp-32);
printf ("%d degree F is %f degree celsius\n",temp,cel);
printf ("Do you have other temperature?");
repeat=getchar();
putchar('\n');
}
while (repeat=='y');
getch();
return 0;
}