answersLogoWhite

0

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);

}

User Avatar

Wiki User

16y ago

What else can I help you with?

Continue Learning about Engineering

Write a C Program to print sum of squares of odd numbers?

#include


Write a C program to calculate the sum of squares of numbers from 1 to N?

#include &lt;iostream&gt; using namespace std; int main() { int i,sum; // variables sum = 0; // initialize sum /* recursive addition of squares */ for (i = 1; i &lt;= 30; i++) sum = sum + (i * i); cout &lt;&lt; sum &lt;&lt;" is the sum of the first 30 squares." &lt;&lt; endl; return 0; }


Write algorithm compute sum of square of N numbers?

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.


WAP To print the squares of all even numbers from 1 to 20?

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


Write a program to find the sum of squares of the given number?

#include&lt;stdio.h&gt; int main() { int count,i,j,k,n,*a,sum=0; printf("Enter the value of 'n':"); scanf("%d",&amp;n); a=malloc(n*sizeof(int)); for(i=1;i&lt;=n;i++) { count=0; j=1; while(j&lt;=i) { if(i%j==0 &amp;&amp; i!=2) count++; j++; } if(count==2 count==1) { for(k=0;k&lt;=n;k++) a[k]=i; } } for(k=0;k&lt;=n;k=k+1) printf("%d\t",a[k]); for(k=0;k&lt;=n;k=k+2) sum+=a[k] * a[k]; printf("The sum of squares of alternative prime numbers is=%d",sum); getchar(); return 0; }

Related Questions

What whole numbers have squares between 10 and 65?

There are an infinite amount of numbers that that have squares between 10 and 65


Write a C Program to print sum of squares of odd numbers?

#include


How do you determine if a number has 3 factors?

Squares of prime numbers have three factors.


Difference between the sum of the squares and the square of the sums of n numbers?

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


How many prime numbers have squares between 100 and 300?

There are two prime numbers with squares between 100 and 300. These prime numbers are 11 and 13. (112 = 121 and 132 = 169.)


How many numbers between 2 and 20 are perfect squares?

Three numbers.


How many numbers between 30 and 50 are perfect squares?

Two. 36, and 49 are perfect squares.


How many perfect squares are between 900-1000?

1900


How many numbers lie between the squares of 13 and 14?

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.


What is the relationship between composite numbers and rectangular numbers?

Rectangular numbers are a subset of composite numbers. The squares of prime numbers will be composite but not rectangular.


What is a productogon?

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?


How many whole numbers lie between the squares of 40 and 41?

39