#include<stdio.h>

#include<math.h>

void main()

{

float pow = 2.0, nr, dr = 1.0, x1, sum;

int i = 1,n,s = -1,x;

clrscr();

printf("\n\n\t ENTER THE ANGLE...: ");

scanf("%d", &x);

x1 = 3.142 * (x / 180.0);

sum = 1.0;

nr = x1*x1;

printf("\n\t ENTER THE NUMBER OF TERMS...: ");

scanf("%d",&n);

while(i<=n)

{

dr = dr * pow * (pow - 1.0);

sum = sum + (nr / (dr * s));

s = s * (-1);

pow = pow + 2.0;

nr = nr * x1 * x1;

i++;

}

printf("\n\t THE SUM OF THE COS SERIES IS..: %0.3f", sum);

getch();

}

🙏

🤨

😮

😂

Q: C program to find sum of cosine series?

Write your answer...

Writing a program for a sum of sine series requires a rather long formula. That formula is: #include #include #include main() { int i,n,x; .

What is the assembly program to generate a geometric series and compute its sum The inputs are the base root and the length of the series The outputs are the series elements and their sum?

It depends on the series.

Where are the numbers that you want to sum.

The sum of the natural numbers cannot be found by any method, iterative or not, as the series is infinitely long. Please restate the question.

write an assembly language program to find sum of N numbers

int sum = 0; int n = 0; while( sum <= 999 ) { sum += (++n); }

Sine(A+ B) = Sine(A)*Cosine(B) + Cosine(A)*Sine(B).

The Nth partial sum is the sum of the first n terms in an infinite series.

Write a program to find the number and sum of all integers from 100 to 300 that are divisible by 11

As you can see, this series is the sum of the sequence: 1, 2, 3, 4, 5, 6. That is to say: 1 + 2 = 3 3 + 3 = 4 6 + 4 = 10 10 + 5 = 15 15 + 6 = 21 To program this in C, you would want a simple incremental counter which would be added to the series sum on each iteration of the loop. { int c = 2; int sum = 1; // loop until you find all the numbers you want while(1) { // increase the running sum to find the next next number in the series sum += c; // increment our counter ++c; } }

#include<stdio.h> main() { int i,n,sum = 0; printf("Program to find sum of n natural number\n"); printf("Enter the value of n "); scanf("%d",&n); for (i = 0;i <= n;i++) { sum = sum + i * i; } printf("The sum is %d",sum); }

write a program to find the sum of squares up to 50

You add numbers as follows: sum = a + b;

//COSINE SERIES #include<stdio.h> #include<conio.h> #include<math.h> main() { int i,n,x; float t,s; clrscr(); printf("enter the value of x,n \n"); scanf("%d%d",&x,&n); t=1; s=1; for(i=1;i<n;i++) { t=(-1)*((pow(x,2)*t*i))/((2*i)*((2*i-1)*i)); s=s+t; printf("s=%6.2f & t=%6.2f\n",s,t); } printf("\n sum of the cos series=%5.2f\n",s); }

Let's assume that you want the sum of the general harmonic series: sum(n=0,inf): 1/(an+b) Since we know that the harmonic series will converge to infinity, we'll also assume that you want the sum from 0 to n. double genHarmonic(const double n, const double a, const double b) { double sum = 0.0; // perform calculations int k; for(k = 0; k <= n; ++k) { sum += 1.0 / (a * k + b); } return sum; }

Algorithm and Flowcharts for a program to compute the sum of the squares of the numbers for a given range used for loop

matrix

sum = 0; for (int i = 12; i

Did you know that memory allocation is not needed to display the matrix? However, the C program is to find the sum of all the elements.

Set two variables "a" and "b" to the starting number of the Fibonacci series, for example, 1 and 1. Then, repeatedly (i.e., in a loop) set: sum = a + b; b = a; a = sum; ... and print the sum (or equivalently, variable "a").

double[] numsToSum; // the numbers you want to find the sum of double sum = 0.0; for(int i = 0; i < numsToSum.length; ++i) { sum += numsToSum[i]; }

Partial sum is a sum of part of the infinite series. However, series is called a sum of all the terms in infinite series. Hence partial sum is a finite series.

sample program in sum of the series using the formula for s=n/2[2a+{n-1}d] in 8085

In Java: // This program adds all numbers in the array int sum = 0; for (int i = 0; i < myArray.length(); i++) { sum += myArray[i]; }In Java: // This program adds all numbers in the array int sum = 0; for (int i = 0; i < myArray.length(); i++) { sum += myArray[i]; }In Java: // This program adds all numbers in the array int sum = 0; for (int i = 0; i < myArray.length(); i++) { sum += myArray[i]; }In Java: // This program adds all numbers in the array int sum = 0; for (int i = 0; i < myArray.length(); i++) { sum += myArray[i]; }