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 difference between oop and pop?
What is the full form of oops?
What is the types of inheritance?
Which language is not a true object oriented programming language?
Why is abstraction needed?
What is overriding in oop?
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.
What are two types of polymorphism?
Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)
What is the main feature of oop?
Is oop better than procedural?
What do you mean by Encapsulation?
What is byval and byref? What are differences between them?
What does <> mean pseudocode?
Which method cannot be overridden?