Обсуждения
Please what's the "Id" do, or mean
0 голосов
2 ответовWhat C# can now do, what other can't?
-2 голосов
2 ответовdouble arr[]={5,2,7,8,11,9};
int n = sizeof(arr) / sizeof(arr[0]);
double sum = 0;
for(int i=0;i<n;i++)
{
sum+= arr[i];
}
double avg = sum / n;
cout<< "avarage ="<< avg<< endl;
return 0;
)
/*what does int n= sizeof(arr[]) /sizeof(arr[0]);
do, can someone explain that line for me*/
0 голосов
3 ответов
what have i to do, if i want that the program always writes for example :
0+1
1+2
3+3
6+4
10+5
15+6
...
because now it just writes
1
3
6
10
15
...
and maybe if it works, can i make then
0+1=1
1+2=3
3+3=6
6+4=10
#include <iostream>
using namespace std;
int main(){
int i;
int sum = 0;
for (i = 1; i <= 100; i++){
sum = sum+i;
cout<<sum<<endl;
}
cout<<sum;
return 0;
}
1 голос
5 ответовАктуальное сегодня
Help please?
4 Votes
Ejercicio Pytho
0 Votes
What is that z for
0 Votes
Suggestions needed
4 Votes
Game development
0 Votes
Ruby programming?
3 Votes