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


Please Help Members By Posting Answers For Below Questions

What is difference between oop and pop?

847


What is the full form of oops?

900


What is the types of inheritance?

786


Which language is not a true object oriented programming language?

855


Why is abstraction needed?

746


What is overriding in oop?

769


hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.

1734


What are two types of polymorphism?

799


Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)

3807


What is the main feature of oop?

880


Is oop better than procedural?

755


What do you mean by Encapsulation?

799


What is byval and byref? What are differences between them?

1925


What does <> mean pseudocode?

822


Which method cannot be overridden?

753