C++ Program to Find the Average of Two Numbers:
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
int main()
{
float a,b,c;
float avg;
clrscr();
cout<<"Enter the Value of a"<<endl;
cin>>a;
cout<<"Enter the value of b"<<endl;
cin>>b;
c=a+b;
avg=c/2;
cout<<"Average is:"<<avg;
getch();
return(0);
}
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
int main()
{
float a,b,c;
float avg;
clrscr();
cout<<"Enter the Value of a"<<endl;
cin>>a;
cout<<"Enter the value of b"<<endl;
cin>>b;
c=a+b;
avg=c/2;
cout<<"Average is:"<<avg;
getch();
return(0);
}
0 comments:
Post a Comment