Monday, March 26, 2012

Program to find sum of two numbers using function


/*****************<soeasyprograms.blogspot.in>******************/
/*Program to find sum of two numbers using function*/

#include<stdio.h>
#include<conio.h>
 void main()
{
             float a,b,s;
             float sum(float,float);
            clrscr();
            printf("Enter the two numbers a and b\n");
            scanf( "%f%f",&a,&b);
            s=sum(a,b);
            printf("\nThe sum is %f ",s);
             getch();
 }

float sum(float a,float b)
{
                float p;
                p=a+b;
                return(p);
}
            /*End of program*/
/*****************<soeasyprograms.blogspot.in>******************/


No comments:

Post a Comment