Write a program in c++ to read two floating point numbers
and find their sum and average.
Answer Posted / kiranlivz
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float a,b,sum,avg;
cout<<"Enter 2 digits"<<endl;
cin>>a>>b;
cout<<"the 2 digits are:"<< " ";
cout<<a<<" "<<b<<;
sum=a+b;
avg=(a+b)/2;
cout<<"sum of the no."<<" ";
cout<<sum<<endl;
cout<<"avg of the no."<<" ";
cout<<avg;
getch();
}
| Is This Answer Correct ? | 15 Yes | 10 No |
Post New Answer View All Answers
how to get the oracle certification? send me the answer
any one please tell me the purpose of operator overloading
What are two types of polymorphism?
What is the example of polymorphism?
Can private class be inherited?
What is the highest level of cohesion?
Why is oop better than procedural?
Can we override main method?
What is polymorphism programming?
Why is oop useful?
What are the advantages of polymorphism?
What is persistence in oop?
Why do we use oop?
What are the three main types of variables?
Is react oop?