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

Why is it called c++?

987


What is the full form of c++?

1282


Describe private, protected and public – the differences and give examples.

1146


Why would you use pointers in c++?

1114


What is the precedence when there is a global variable and a local variable in the program with the same name?

1083


What are the basic data types used in c++?

1016


What you know about structures in C++?

1029


What is heap sort in c++?

1027


Is java a c++?

1009


Should the member functions which are made public in the base class be hidden?

988


What is #include ctype h in c++?

1133


What is the function of I/O library in C++ ?

1145


What is static function? Explain with an example

1019


Is multimap sorted c++?

970


how to explain our contribution in the project?

3656