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
What are the advantages of early binding?
What is c++ similar to?
Array base access faster or pointer base access is faster?
What will happen if a pointer is deleted twice?
Can we use clrscr in c++?
How do you remove an element from a set in c++?
What is the type of 'this' pointer?
How do you find out if a linked-list has an end?
What are the different types of polymorphism in c++?
What is the difference between c++ and turbo c++?
What is virtual destructor? What is its use?
program explaining feautures of c++
What is increment operator in c++?
What is a null object in c++?
How much do coding jobs pay?