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
Why is polymorphism important in oop?
What is encapsulation selenium?
What is multilevel inheritance?
What is polymorphism what are the different types of polymorphism?
Can we define a class within the interface?
Why is polymorphism used?
What is the significance of classes in oop?
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
What is object in oops?
What are the features of oop?
What is the point of oop?
What is the difference between abstraction and polymorphism?
What is encapsulation in simple terms?
Why is static class not inherited?
How is polymorphism achieved?