Write a function in C for adding two numbers by taking argument

 Write a function in C for adding two numbers by taking argument


#include <stdio.h>
#include<stdio.h>
void add(float,float);
void add(float a ,float b)
{
float res;
res=a+b;
printf("%.2f",res);
}
int main(){
float a,b;
printf("Enter first number: ");
scanf("%f",&a);
printf("Enter second number: ");
scanf("%f",&b);
add(a,b);
return 0;
}


Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.