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
What is overloading in oops?
what type of questions
Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.
What are the types of abstraction?
What is multilevel inheritance explain with example?
What is the main feature of oop?
Can static class have constructor?
Explain the advantages of inheritance.
any one please tell me the purpose of operator overloading
Why is oop better than procedural?
what type of question are asked in thoughtworks pair programming round ?
What is polymorphism oop?
There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.
What is multilevel inheritance in oop?
Templates mean