Simple Program for Addition of Two Number's using User Define Function.
Code:
Code:
//C Program for Addition of Two Number's using User Define Function
#include<stdio.h>
#include<conio.h>
float add(float,float);
void main()
{
float a,b,c;
clrscr();
printf("Enter the value for a & b\n\n");
scanf("%f
%f",&a,&b);
c=add(a,b);
printf("\nc=%f",c);
getch();
}
float add(float x,float y)
{
float z;
z=x+y;
return(z);
}
Hope you liked my posts, give comments if you have any doubts.. :)#include<stdio.h>
#include<conio.h>
float add(float,float);
void main()
{
float a,b,c;
clrscr();
printf("Enter the value for a & b\n\n");
scanf("%f
%f",&a,&b);
c=add(a,b);
printf("\nc=%f",c);
getch();
}
float add(float x,float y)
{
float z;
z=x+y;
return(z);
}
1 comments:
fantastic work, its a really great and informative for us.........beginners of c programming.
Post a Comment