Answer to Question #315045 in C++ for Silan

Question #315045

Write a program that will get two numbers and print the average


1
Expert's answer
2022-03-21T12:36:18-0400
#include<iostream>
using namespace std;
int main(int argc, char *argv[]){
float a,b;
cout<<"Please, enter two values:";
cin>>a>>b;
float res=(a+b)/2;
cout<<"The average is "<<res;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog