Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write a program to calculate the following
i want a c++program for this condition
1+4+9+16+….+100

Like this (1^2+2^2)

Hint use function pow(a,b)

Answer Posted / b sohan lal

#include<iostream.h>
void main()
{
init i,n,k,sum;
clrscr();
sum=0;
cout<<"enter the max limit:";
cin>>n;
i=1;
while(k<=n)
{
k=i*2;
sum=sum+k;
i++;
}
cout<<"result="<<sum;
getch();
}

Is This Answer Correct ?    6 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Should the this pointer can be used in the constructor?

1074


Difference between an inspector and a mutator

1387


What are the various storage classes in C++?

1184


What is increment operator in c++?

1058


Where can I run c++ program?

1111


Why is main an int?

1036


How do I use arrays in c++?

1055


Explain the uses oof nested class?

1193


Declare a class vehicle and make it an abstract data type.

1023


How the virtual functions maintain the call up?

1283


What is the most common mistake on c++ and oo projects?

1020


Draw a flow chart and write a program for the difference between the sum of elements with odd and even numbers. Two dimensional array.

6455


What is wrapper class in c++?

1196


How can I learn c++ easily?

1137


What is the use of map in c++?

1194