I wrote this program and my teacher wont accept this because i used
Code:
#include<process.h>
. How can i make this program run without this header.
Can i replace it with something else
Code:
#include <stdio.h>
#include <math.h>
#include<process.h>
int main()
{
char variable;
float d= 0.00;
float sqvelocity =0.00;
float sqtime =0.00;
clrscr();
do
{
printf("\nEnter a value for distance:");
scanf("%f",&d);
sqvelocity= sqrt(2*9.8*d);
sqtime= sqrt((2*d)/9.8);
printf("\nEnter variable for desired computation, \nv (velocity) or \nt (time) \ne (exit) \n\t");
scanf(" %c", &variable);
switch(variable)
{
case 'v': printf("the velocity is: %lf.\n", sqvelocity);
break;
case 't': printf("the time is: %lf.\n", sqtime);
break;
case 'e': exit(1);
break;
default: printf("\nEnter right choice");
}
}while(1);
getch();
return (0);
}