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 C++ Program to Find Sum and Average of three numbers.



Write a C++ Program to Find Sum and Average of three numbers...

Answer / hr

Soluion:
/* C++ Program to Find Sum and Average of three numbers */
#include<iostream>
using namespace std;
int main()
{
float a,b,c,sum,avg;
cout<<"Enter 1st number :: ";
cin>>a;
cout<<"
Enter 2nd number :: ";
cin>>b;
cout<<"
Enter 3rd number :: ";
cin>>c;
sum=a+b+c;
avg=sum/3;
cout<<"
The SUM of 3 Numbers [ "<<a<<" + "<<b<<" + "<<c<<" ] = "<<sum<<"
";
cout<<"
The AVERAGE of 3 Numbers [ "<<a<<", "<<b<<", "<<c<<" ] = "<<avg<<"
";
return 0;
}
Output:
/* C++ Program to Find Sum and Average of three numbers */
Enter 1st number :: 3
Enter 2nd number :: 4
Enter 3rd number :: 5
The SUM of 3 Numbers [ 3 + 4 + 5 ] = 12
The AVERAGE of 3 Numbers [ 3, 4, 5 ] = 4
Process returned 0

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ Interview Questions

What is the 4 difference between delete[] and delete?

0 Answers   Alter,


What is C++11?

1 Answers   Adobe,


What is pass by value & reference.

0 Answers   Accenture,


How do you write a function that can reverse a linked-list in C++?

0 Answers   IBS,


What do you know about Volatile keyword in C++? Explain with an example code.

0 Answers   Adobe,


Write a C++ Program to Find whether given Number is Odd or Even.

1 Answers  


Explain function prototypes in C++.

0 Answers   Aricent,


Write a program that can take input from 3 to 8 and calculate the average?

0 Answers   Accenture,


What is the difference between Stack and Queue in C++?

0 Answers   Global Logic, iNautix,


Describe the different styles of function prototypes in C++.

0 Answers   Adobe,


When would you choose to return an error code rather than throw an exception?

0 Answers   Amazon,


What is the difference between malloc, calloc and realloc?

0 Answers   Alter,


Categories