Write a C++ Program to Find Sum and Average of three numbers.
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 |
Write a C++ Program to Find Sum and Average of three numbers.
Write a C++ Program to find Addition of Two Numbers.
Tell me about virtual function
Discuss the role of C++ shorthands.
Tell How To Check Whether A Linked List Is Circular ?
write a program To generate the Fibonacci Series.
How does stack look in function calls? Write a recursive function call, how will the stack look like?
What is a class in C++?
1 Answers Amazon, TCS, UGC Corporation,
Is deconstructor overloading possible? If yes then explain and if no Then why?
What kind of problems does name mangling cause?
In C++ what do you mean by Inheritance?
Explain the FOR loop with a help of a code.