main()
{
int i,sumo=0,sume=0,oddno,evenno;
for(i=1,oddno=1,evenno=2;i<=100;++i,oddno=oddno+2,evenno=evenno+2)
{
sumo=sumo + oddno;
sume=sume + evenno;
}
printf("Sum of odd nos = %d And Sum of even nos = %d,sumo,sume);
}
#include
#include <iostream> using namespace std; int main() { int i,sum; // variables sum = 0; // initialize sum /* recursive addition of squares */ for (i = 1; i <= 30; i++) sum = sum + (i * i); cout << sum <<" is the sum of the first 30 squares." << endl; return 0; }
Oh, what a lovely question! To compute the sum of the squares of N numbers, you can create a simple algorithm. Start by initializing a variable to hold the sum, then loop through each number, square it, and add it to the sum. Once you've done this for all N numbers, you'll have the sum of their squares. Just like painting a happy little tree, take your time and enjoy the process.
CLS PRINT "PROGRAM: Print squares of all even numbers from 1 to 20" PRINT PRINT "number", "squared" PRINT FOR number% = 1 TO 20 IF number% MOD 2 = 0 THEN PRINT number%, number% * number% END IF NEXT END
#include<stdio.h> int main() { int count,i,j,k,n,*a,sum=0; printf("Enter the value of 'n':"); scanf("%d",&n); a=malloc(n*sizeof(int)); for(i=1;i<=n;i++) { count=0; j=1; while(j<=i) { if(i%j==0 && i!=2) count++; j++; } if(count==2 count==1) { for(k=0;k<=n;k++) a[k]=i; } } for(k=0;k<=n;k=k+1) printf("%d\t",a[k]); for(k=0;k<=n;k=k+2) sum+=a[k] * a[k]; printf("The sum of squares of alternative prime numbers is=%d",sum); getchar(); return 0; }
There are an infinite amount of numbers that that have squares between 10 and 65
#include
Squares of prime numbers have three factors.
Difference between the sum of the squares and the square of the sums of n numbers?Read more:Difference_between_the_sum_of_the_squares_and_the_square_of_the_sums_of_n_numbers
There are two prime numbers with squares between 100 and 300. These prime numbers are 11 and 13. (112 = 121 and 132 = 169.)
Three numbers.
Two. 36, and 49 are perfect squares.
1900
The square of 13 is (169) and the square of 14 is (196). To find the numbers that lie between these two squares, we consider the integers from (170) to (195). There are (195 - 170 + 1 = 26) integers in that range. Thus, there are 26 numbers that lie between the squares of 13 and 14.
Rectangular numbers are a subset of composite numbers. The squares of prime numbers will be composite but not rectangular.
it is a triangle with circles at the corners, and squares in the middle of the corners. The squares have numbers in them, and you have to put numbers in the circles. However, the numbers in the circles have to add up to the number of the square between them. Simple, right?
39