# Thread: Help me do my task

1. ## Help me do my task

Hello. Sorry for bad english first of all, I'm not a native speaker. So I've got a task to program in C language and I just can't figure out how to solve it and do it properly --- I'm very new to programming so yeah... The task is: Make a program, that whenever you type some kind of number, it displays its squares total sum. For example if I type in the program let's say 4, it will be (1*1+2*2+3*3+4*4) and it will show me the answer of 30, or if I type 6 (1*1+2*2+3*3+4*4+5*5+6*6) it will be 91. I'm guessing this has something to do with while () function? Thanks for taking your time  2. Originally Posted by mykelis Hello. Sorry for bad english first of all, I'm not a native speaker. So I've got a task to program in C language and I just can't figure out how to solve it and do it properly --- I'm very new to programming so yeah... The task is: Make a program, that whenever you type some kind of number, it displays its squares total sum. For example if I type in the program let's say 4, it will be (1*1+2*2+3*3+4*4) and it will show me the answer of 30, or if I type 6 (1*1+2*2+3*3+4*4+5*5+6*6) it will be 91. I'm guessing this has something to do with while () function? Thanks for taking your time so ill give you a clue first you need an input
Code:
`scanf("%d", &num);`
then use that input to determine how many times you want that loop to work.
Code:
```for(i=1;i<=num;i++) {  Popular pages Recent additions answer, displays, program, task, type 