CSPrograms4u
Nothing Succeeds Like Success
Home
About
C
Programs
Numbers
Patterns
Conversions
C Practical File
PPTs
CPP
Programs
PPTs
CG
Programs
PPTs
DS
Programs
PPTs
Python
Programs
Java
Programs
PPT
Practical File
C#
Programs
PPTs
VB
Programs
PPTs
VB 2010
Programs
PPTs
Sunday, 8 April 2018
1/1+1/4+1/9+.......+1/n^2
//1/1+1/4+1/9+.......+1/n^2
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int i,n;
float sum=0;
clrscr();
printf("Enter the value of n\n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
sum=sum+(1/pow(i,2));
}
printf("\n1/1+1/4+1/9.....+1/n^2=%.4f",sum);
getch();
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Followers
Total Pageviews
Popular Posts
Java Arrays
1. 1 D Array 2. 2 D Array 3. Matrix Addition 4. Matrix Substraction 5. Matrix Multiplication 6. Transpose of a Matrix ...
Classes Objects and Methods in JAVA
Program No 1:- Use of class in Java Program No 2:- default constructor in Java Program No 3:- Parameterized Constructor in Java Pro...
1D Array
import java.util.Scanner; public class Array1D { public static void main(String args[]) { Scanner sc=new Scanner(Sy...
Matrix Addition
package Mobile.Arrays; import java.util.Scanner; public class Matrix_Addition { public static void main(String args[]) { ...
No comments:
Post a Comment
Note: only a member of this blog may post a comment.