Its giving me errors
prog.cpp: In function 'int main()':
prog.cpp:7:5: error: expected ';' before string constant
cout"Enter loop limit : a";
^
prog.cpp:8:5: error: expected ';' before string constant
cout"Enter 1st value :";
^
prog.cpp:10:5: error: expected ';' before string constant
cout"Enter 2nd value :";
^
prog.cpp:12:5: error: expected ';' before string constant
cout"Enter 3rd value :";
^
prog.cpp:14:5: error: expected ';' before string constant
cout"Enter 4th value :";
^
prog.cpp:16:5: error: expected ';' before string constant
cout"Enter 5th value :";
^
prog.cpp:19:5: error: expected ';' before string constant
cout"The sum of entered values = "iendl;
^
prog.cpp:20:5: error: 'iendl' was not declared in this scope
i=i/iendl;
^
prog.cpp:21:5: error: expected ';' before string constant
cout"Average value ="iendl;
^
prog.cpp:23:1: error: expected '}' at end of input
}
^
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
#include<iostream>
using namespace std;
int main()
{
int i;
cout"Enter loop limit : 5"endlendl;
cout"Enter 1st value :";
cin>>i;
cout"Enter 2nd value :";
cin>>i;
cout"Enter 3rd value :";
cin>>i;
cout"Enter 4th value :";
cin>>i;
cout"Enter 5th value :";
cin>>i;
i=i+i+i+i+i;
cout"The sum of entered values = "iendl;
i=i/5;
cout"Average value ="iendl;
|