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 / ashok ak

#include<iostream>
using namespace std;
int main()
{
int a=0,n;
cout<<"Enter the Number ";
cin>>n;
for(int i=1;i<=n;i++)
a+=pow(i,2);
cout<<"The Sum of Total is "<<a;
return 0;
}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of early binding?

1117


What is c++ similar to?

1256


Array base access faster or pointer base access is faster?

2361


What will happen if a pointer is deleted twice?

1252


Can we use clrscr in c++?

1133


How do you remove an element from a set in c++?

1140


What is the type of 'this' pointer?

1062


How do you find out if a linked-list has an end?

1182


What are the different types of polymorphism in c++?

1197


What is the difference between c++ and turbo c++?

1306


What is virtual destructor? What is its use?

1122


program explaining feautures of c++

2496


What is increment operator in c++?

1060


What is a null object in c++?

1315


How much do coding jobs pay?

1066