Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
1
Answer
is the program valid or not? I am confused.
Md Nayeem
7y
299
1
Reply
// 1^2+2^2+3^2+.......+n^2?
#include
int
main()
{
int
i,n,result=0;
printf(
"Enter n="
);
scanf(
"%d"
,&n);
for
(i=1;i<=n;i++)
{
printf(
"%d"
,i);
result=result+i*i;
}
printf(
"\nResult=%d\n"
,result);
getch();
}
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
packet moditification for specific url/ domain interception
I am new in C programming language .so i am confused how can