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

In a function declaration what does extern means?

1108


Why we use #include conio h in c++?

1107


Why should you learn c++?

1065


Is c++ vector dynamic?

1216


How a new operator differs from the operator new?

1189


What is the difference between function overloading and operator overloading?

1182


What things would you remember while making an interface?

1058


What does iomanip mean in c++?

1283


How do you establish an is-a relationship?

1217


What is the use of setprecision in c++?

1057


What is a rooted hierarchy?

1224


Differentiate between C and C++.

1328


What is the difference between mutex and binary semaphore?

1299


How do you differentiate between overloading the prefix and postfix increments?

1143


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

6457