Saturday, December 17, 2011

C++ Programme for Print out the summation of square from 1 to n.

#include<stdio.h>
int main()
{
    int i=1*1;
    int ver;
    int sum=0;
    printf("Enter The veriable");
    scanf("%d",& ver);
    for( ;i<=ver;i++)
{
    sum=i*i+sum;
}
    printf("%d",sum);
return 0;
}

No comments:

Post a Comment