Write the program of the following :
To find the sum of squares of odd numbers up to 10 terms
Answers
Answered by
10
Explanation:
HERE IS THE CODE FOR THE SUM OF SQUARES OF ODD NUMBERS UPTO 10 TERMS
ITS IN C LANGUAGE
#include<stdio.h>
void main()
{
int NUM,i,j,SUM=0;
clrscr();
printf(“\nENTER INTERGER NUMBER : “);
scanf(“%d”,&NUM);
for(i=1;i<NUM+1;i++)
{
if(i%2!=0)
{
SUM=SUM+(i*i);
}
}
printf(“\nTHE SUM OF SQUARE OF ODD NOS. TILL %d NO. IS : %d”,NUM,SUM);
getch();
}
I HOPE THIS HELPS U
PLEASE MARK IT AS BRANLIEST ANSWER
Answered by
1
Explanation:
#include<studio.h>
#include<conio.h>
void main()
{
int i,n,sum=0;
clrscr();
printf("how many numbers have to print:");
scanf("%d";&n);
for(i=0;i<11;i++)
{
if(i%2=!0)
{
sum=sum+(i×i);
}
}
printf("sum of squares of odd numbers up to 10
terms=%d", sum);
getch();
}
Similar questions