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 are the 4 main oop principles?
when to use 'mutable' keyword and when to use 'const cast' in c++
What is debug class?what is trace class? What differences are between them? With examples.
What is property in oops?
Why is oop better than procedural?
What is basic concept of oop?
What is inheritance in simple words?
What is variable example?
what is graphics
What is polymorphism programming?
What is object in oop with example?
What is object and example?
Can an interface inherit a class?
Which language is not a true object oriented programming language?
Whats is abstraction in oops?