It is a simple C program on mathematical calculation. It will perform an addition, multiplication and many operations at once. This C program can be used for all kind of students for their lab exams and related tests. It may be useful for their exam purpose.
[SEE: IT Related Abroad Studies] & [Bike Back Wordings]
Mathematical calculation program
Input of two numbers and work out their addition, average, multiply, subtract, division functions. This makes C program can be use as a simple calculator. And this program will used in many places like example program, lab exercises, and simple explanation of C programming exams. It can perform a math function in between of two numbers.
[Useful: IT Company Details] & [Education Loan Guide]
C PROGRAM:
/* Title: Calculate Program
© http://students3k.com
This website provides lots of useful information for all students.
*/
# include <stdio.h>
# include <conio.h>
void main()
{
clrscr();//function to clear previous output.
// Program variables
int value1,value2,add,multiply,subtract;
float avg,divide;
printf("Enter first value : ");//displaying function
scanf("%d",&value1);//getting input function
printf("Enter second value : ");
scanf("%d",&value2);
//making add function for a given to value
add = value1 + value2;
printf("\nadd = %d",add);
//making average for a given value
avg = sum/2.0;
printf("\nAvg = %.2f",avg);
//making multiply function
multiply = value1*value2;
printf("\n Multiply = %d",multiply);
//Making subtract function for given two value
subtract = value1-value2;
printf("\n Subtract = %d",subtract);
//Making division for given two values
divide = (float)value1/value2;
printf("\n Divide = %.2f",divide);
getch();
}
If you find the stuff is useful, then feel free to share about us in all social networking websites.