0
Can anyone help me with this console application?
Hi, So I have this excercise that I gotta make but i’m stuck I wrote a code for a user to give 20 random numbers. But now I have to give the sum of the 5th, 10th and 15th number. I heard other people talk about arrays but I didnt learn that yet at school. It was one week before I was gonna learn Arrays and lists. So can anyone help me with this problem? Is there another way for me to find the sum? Btw im using c#
1 ответ
0
Yes, you can use only "for":
s=0;
for(i=0; i<20; i++){
// random
if(i%5==0 && i>0) s+= /* your random*/;
}