Write a program in c++ to read two floating point numbers
and find their sum and average.
Answer Posted / mahmali
#include<iostream.h>
#include<conio.h>
main()
{
float a,b,sum,avg;
cout<<"Enter values of a and b";
cin>>a>>b;
sum=a+b;
avg=sum/2;
cout<<"sum of the no.="<<sum;
cout<<"avg of the no.="<<avg;
getch();
}
| Is This Answer Correct ? | 2 Yes | 5 No |
Post New Answer View All Answers
What is the difference between encapsulation and polymorphism?
What is encapsulation example?
What is encapsulation in oops?
What is an example of genetic polymorphism?
Why do we need polymorphism in c#?
what is different between oops and c++
What is polymorphism what are the different types of polymorphism?
program for insertion ,deletion,sorting in double link list
What is polymorphism and example?
What is multilevel inheritance explain with example?
Why polymorphism is used in oops?
Explain the concepts involved in Object Oriented programming.
What is multilevel inheritance?
Why is oop better than procedural?
What is abstraction in oop?