Wednesday 13 June 2012

Program to add two numbers using function

June 13, 2012 Posted by Knowledge Bite No comments

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

void main()
{
  float add(float,float);
  float a,b,sum;
     printf("enter the value of a and b\n");
  scanf("%f%f",&a,&b);

  sum=add(a,b);

     printf("the sum of a and b is  %f",sum);

   getch();
 }

 float add(float aa,float bb)
   {
    float sum;

    sum=aa+bb;
   return sum;
  }

0 Comments:

Post a Comment