Skip to content

Commit

Permalink
functions with cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Warishayat committed Jan 24, 2024
1 parent 00959c4 commit 6fa07a3
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions day8.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include<iostream>
#include<cmath>
using namespace std;
float avg(float a,float b )
{
int result= (a+b)/2;
return result;
}
int add(int a,int b)
{
int result=a+b;
return result;

} //function prototype

string welcom(string name)
{
return "welcome " + name;
}
int main()
{
float a;
float b;
cin>>a>>b;
float result=avg(a,b);
int getvalue=add(a,b);
string name="waris";
string value=welcom(name);
cout<<"The value of Average is:"<<result<<endl;
cout<<"The value of Add function is:"<<getvalue<<endl;
cout<<"The value of welcome function is:"<<value<<endl;
cout<<pow(2,3)<<" the two power three is"<<endl;


}

0 comments on commit 6fa07a3

Please sign in to comment.