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 polymorphism used for?
What is the importance of oop?
Are polymorphisms mutations?
write string class as your own class in java without using any built-in function
What is polymorphism in oops with example?
Why is object oriented programming so hard?
What are classes oop?
What is pure oop?
What does and I oop mean?
What are the 4 main oop principles?
What is multilevel inheritance explain with example?
Is data hiding and abstraction same?
when to use 'mutable' keyword and when to use 'const cast' in c++
write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory
Is abstract thinking intelligence?