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
Explain the concepts involved in Object Oriented programming.
What is the real time example of encapsulation?
just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.
Why multiple inheritance is not possible?
What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?
what are the different types of qualifier in java?
What is polymorphism what are the different types of polymorphism?
Which is better struts or spring?
How to improve object oriented design skills?
What is methods in oop?
What is abstract class in oop?
What is the highest level of cohesion?
What are two types of polymorphism?
What is cohesion in oop?
What does and I oop and sksksk mean?