Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Why is polymorphism important in oop?

1073


What is encapsulation selenium?

999


What is multilevel inheritance?

1198


What is polymorphism what are the different types of polymorphism?

1008


Can we define a class within the interface?

1032


Why is polymorphism used?

1035


What is the significance of classes in oop?

1144


Will I be able to get a picture in D drive to the c++ program? If so, help me out?

2191


What is object in oops?

1056


What are the features of oop?

1166


What is the point of oop?

1182


What is the difference between abstraction and polymorphism?

1091


What is encapsulation in simple terms?

1035


Why is static class not inherited?

1102


How is polymorphism achieved?

1055