C PROGRAM TO FIND SUM OF THREE NUMBERS UPDATED
#unclude<stdio.h>
#include<conio.h>
void main();
int a,b,c;
int sum;
void sum();
void read();
void display();
printf("enter the numbers one by one");
read();
printf("sum=");
sum();
display();
read()
{
scanf("%d%d",&a,&b,&c);
if(a==0)
{
printf("enter the number again");
scanf("%d",&a);
}
sum()
{
sum=a+b+c;
}
display()
{
printf("%d",sum);
}
getch();
}
#include<conio.h>
void main();
int a,b,c;
int sum;
void sum();
void read();
void display();
printf("enter the numbers one by one");
read();
printf("sum=");
sum();
display();
read()
{
scanf("%d%d",&a,&b,&c);
if(a==0)
{
printf("enter the number again");
scanf("%d",&a);
}
sum()
{
sum=a+b+c;
}
display()
{
printf("%d",sum);
}
getch();
}
Comments
Post a Comment