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


Please Help Members By Posting Answers For Below Questions

What are the 4 main oop principles?

685


when to use 'mutable' keyword and when to use 'const cast' in c++

1642


What is debug class?what is trace class? What differences are between them? With examples.

1608


What is property in oops?

567


Why is oop better than procedural?

604






What is basic concept of oop?

700


What is inheritance in simple words?

625


What is variable example?

593


what is graphics

2011


What is polymorphism programming?

602


What is object in oop with example?

699


What is object and example?

602


Can an interface inherit a class?

557


Which language is not a true object oriented programming language?

640


Whats is abstraction in oops?

591