Home
C Programming Language
_Tutorials
_Programs
Python Programming
Data Analytics
About Us
Contact Us
Privacy Policy
MyShop24
Geeky Session
Home
C Program
C Program To Print Sum Of 1+1/2+1/3...1/n
C Program To Print Sum Of 1+1/2+1/3...1/n
Geeky Session
Hello friends, in this example, you will learn how to find
the sum of series 1+1/2+1/3+1/4.....1/n
entered by the user in C programming language using following topics:
Arithamatic Operators
Conditions Statements
The for Loops
Program:
#include
int main() { int n,i,sum=0; printf("Enter number of opration: \n"); scanf("%d",&n); printf("1"); for(i=2;i<=n;i++) printf("1/%d",i); for(i=1;i<=n;i++) sum=sum+n; printf("1/%d",n); printf("sum of number is=1/%d",sum+1/n); return 0; }
Output:
Enter number of opration: 7
sum of number is= 49
Post a Comment
1 Comments
Shiksha
13/04/2020, 13:29
Awesome write-up!!!
Reply
Delete
Replies
Reply
Add comment
Load more...
Tutorials Series
Basic Of Computer
C Program
C Programming
Python Programming Language
Get a .NET @₹399/Yr
Contact Form
Name
Email
*
Message
*
Search Artical
Check Your Website
Translate
POPULAR POSTS
What Is Computer Programing Language And Classification Of Programming Language
What is html elements
What are HTML Attributes
Social Plugin
Popular Posts
Learn C Programming Language |
10/25/2019 02:25:00 pm
Functions in C Programming Language
12/03/2019 12:32:00 pm
What Is Computer Programing Language And Classification Of Programming Language
10/23/2019 07:43:00 pm
1 Comments
Awesome write-up!!!
ReplyDelete