Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions C++/loop
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//Take 10 integers from keyboard using loop and print their average value on the screen.
#include<iostream>
int main()
{
using namespace std;
int sum;
float avg;
for(int i=1;i<=10;i++)
{
int a;
cout<<"enter the value of a= \n";
cin>>a;
sum=sum+a;
}
cout<<"the average of the number you enter is= \n"<<sum/10.0<<endl;
return 0;
}