Some turbo c programs:

problem #1:
> get the sum of two numbers.
problem #2;
> get the average of two numbers.

*use the input process output to solve the problems quickly… *
for problem #1 we use this variables sum, num1,num2:

input: num1,num2
process: sum=num1 + num2
output: sum

for problem #2 we use this variables ave,x,y:

input: x,y
process: ave=(x+y)/2
output: ave

— code —
problem #1:
> get the sum of two numbers.

#include<stdio.h>
main()
{
int sum, num1,num2;
printf(“Enter 1st number:”);
scanf(“%d”,&num1);
printf(“Enter 2nd number:”);
scanf(“%d”,&num2);
sum=num1 + num2;
printf(“the sum is: %d”,sum);
getch();
}

problem #2;
> get the average of two numbers.

#include<stdio.h>
main()
{
float x,y,ave;
printf(“Enter 1st number:”);
scanf(“%f”,&x);
printf(“Enter 2nd number:”);
scanf(“%f”,&y);
ave=(x+y)/2;
printf(“the average is: %f”,ave);
getch();
}