76 327
Assignments Done
Successfully Done
In May 2019

Answer to Question #1337 in C++ for sam2010

Question #1337
Write a c++ program to accept 5 number usin while and print their sum then print the fifth number and second number and print if second is less or bigger of equal to fifth.
Expert's answer
#include <iostream>
using namespace std;

int main()
int i=0,sum=0;
int a[5];
cout<<"Enter five numbers\n";
& cin>>a[i];
& sum=sum+a[i];
& i++;
cout<<"\nSum equals& "<<sum<<endl;
cout<<"Fifth number equqls quot;<<a[4]<<endl;
cout<<"Second number equals& quot;<<a[1]<<endl;
if(a[1]<a[4]) cout<<"Second number is less then fifth\n";
if(a[1]>a[4]) cout<<"Second number is bigger then fifth\n";
if(a[1]==a[4]) cout<<"Second number is equal fifth\n";
return 0;

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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions