Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

/* ROLL NO: 1 SEM-1 ICA DIV: A

NAME : VARUN AGGARWAL SUBJECT: FOP


PROGRAM DEFINITION:Write a program to find sum of three numbers.

*/

#include<stdio.h>
#include<conio.h>

int sum(int,int,int);

int main()
{
FILE *fp;
int s,x,y,z;
clrscr();
printf("Enter 3 nos. : ");
scanf("%d%d%d",&x,&y,&z);
fp=fopen("z:\\area_circle.txt","w");
printf("sum = %d",sum(x,y,z));
fprintf(fp,"sum = %d",sum(x,y,z));
getch();
return 0;
}

int sum(int x,int y,int z)


{
int sum=0;
sum=x+y+z;
return sum;
}
/* INPUT:
Enter 3 nos. : 20 20 50
OUTPUT:
sum = 90
*/

You might also like