Computing.Net > Forums > Disk Operating System > Turbo C++

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Turbo C++

Reply to Message Icon

Name: luigi
Date: May 28, 1999 at 22:11:32 Pacific
Comment:

Is anyone familiar with Turbo C++ language: if so please help. This is the code i have so far but i need the division operater to work when calculating an integer with 0 (zero).

#inclue
float calculate(float, char, float);
main()
{
char operat
float num1;
float num2;
float answer;
do
{
printf("\nEnter a calculation:");
scanf("%f%c%f", &num1,&operat,&num2);
answer=calculate(num1,operat,num2);
printf("%.1f %c %.1f=%f\n\n",num1,operat,num2,answer);
getchar();
}
float calculate(float x, char sign, float y)
}
float z
switch(sign)
{case'/':
z=x/y;
break;
default:
printf("illegal operator");
break;
}
returnz;
}



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Need Help on DOS Version ... CD Rom problem in DOS



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Turbo C++

Need borland turbo c 2.0 *.h & *.lib files www.computing.net/answers/dos/need-borland-turbo-c-20-h-amp-lib-files/65.html

Borland Turbo C++ 3.0 for dos needed www.computing.net/answers/dos/borland-turbo-c-30-for-dos-needed/1408.html

Borland Turbo C++ 3.0 for dos needed www.computing.net/answers/dos/borland-turbo-c-30-for-dos-needed/1456.html