0% found this document useful (0 votes)
22 views3 pages

Noc20-Cs06 Week 05 Assignment 05

The document is a course page for an NPTEL online programming in C course. It provides information about Week 5 Problem 4, which asks students to write a C program to calculate the sum of a series from 1 to N, where N is input by the user. It gives sample test cases and output. It also notes that the due date for this assignment has passed and the student has not submitted it. The page provides a sample solution code that calculates the sum of the series using a for loop and prints the result.

Uploaded by

Suhas Hatti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views3 pages

Noc20-Cs06 Week 05 Assignment 05

The document is a course page for an NPTEL online programming in C course. It provides information about Week 5 Problem 4, which asks students to write a C program to calculate the sum of a series from 1 to N, where N is input by the user. It gives sample test cases and output. It also notes that the due date for this assignment has passed and the student has not submitted it. The page provides a sample solution code that calculates the sum of the series using a for loop and prints the result.

Uploaded by

Suhas Hatti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

03/07/2020 Problem solving through Programming In C - Course

(https://swayam.gov.in) (https://swayam.gov.in/nc_details/NPTEL)

reviewer4@nptel.iitm.ac.in 

NPTEL (https://swayam.gov.in/explorer?ncCode=NPTEL) » Problem solving through Programming In C

(course)

Announcements (announcements)

About the Course (https://swayam.gov.in/nd1_noc20_cs06/preview) Ask a Question (forum)

Progress (student/home) Mentor (student/mentor)

Week-05 Program-04
Course Due on 2020-03-05, 23:59 IST
outline
Write a C program to find sum of following series where the value of N is taken
as input
How does an 1+ 1/2 + 1/3 + 1/4 + 1/5 + .. 1/N
NPTEL online
course work?
Sample Test Cases
Input Output
Week 0
Test Case 1 100 Sum of the series is: 5.19
Week 1
Test Case 2 20 Sum of the series is: 3.60
Week 2
Test Case 3 6 Sum of the series is: 2.45
Week 3

Test Case 4 50 Sum of the series is: 4.50


Week 4

Week 5 The due date for submitting this assignment has passed.
As per our records you have not submitted this assignment.
Lecture 21: For Sample solutions (Provided by instructor)
Statement
1 #include<stdio.h>
(Contd.) (unit? 2 int main()
unit=6&lesson=35) 3 {
4 int N;
Lecture 22: 5 float sum = 0.0;
6 scanf("%d",&N); /*Read the value of N from test cases provided*/
Example of If- 7
Else (unit? 8 /* Complete the program. Please use the printf statement given below:
unit=6&lesson=36) 9
10 printf("Sum of the series is: %.2f",sum);
11
Lecture 23 : 12 */
Example of 13 int i;

https://onlinecourses.nptel.ac.in/noc20_cs06/progassignment?name=121 1/3
03/07/2020 Problem solving through Programming In C - Course

Loops (unit? 14 for(i=1;i<=N;i++)


unit=6&lesson=37) 15 sum = sum + ((float)1/(float)i);
16 printf("Sum of the series is: %.2f",sum);
17 }
Lecture 24 : 18
Example of
Loops (Contd.)
(unit?
unit=6&lesson=38)

Lecture 25 :
Example of
Loops
(Contd.), Use
of FOR Loops
(unit?
unit=6&lesson=39)

Quiz :
Assignment 5
(assessment?
name=104)

Week-05
Problem-01
(/noc20_cs06/progassignment?
name=118)

Week-05
Problem-02
(/noc20_cs06/progassignment?
name=119)

Week-05
Problem-03
(/noc20_cs06/progassignment?
name=120)

Week-05
Program-04
(/noc20_cs06/progassignment?
name=121)

Week-05
Program-05
(/noc20_cs06/progassignment?
name=122)

Feedback For
Week 5 (unit?
unit=6&lesson=130)

Week 6

Week 7

Week 8

Week 9

Week 10

https://onlinecourses.nptel.ac.in/noc20_cs06/progassignment?name=121 2/3
03/07/2020 Problem solving through Programming In C - Course

Week 11

Week 12

DOWNLOAD
VIDEOS

Assignment
Solution

https://onlinecourses.nptel.ac.in/noc20_cs06/progassignment?name=121 3/3

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy