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

Week-03 Program-02: (Https://swayam - Gov.in)

This document provides instructions for a programming assignment in an online NPTEL course on problem solving through programming in C. Students are asked to write a C program to check if a given number is zero, positive, or negative using if/else statements. Sample test cases and outputs are provided. The due date for the assignment has passed. A sample solution is provided by the instructor.

Uploaded by

sdf
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)
59 views3 pages

Week-03 Program-02: (Https://swayam - Gov.in)

This document provides instructions for a programming assignment in an online NPTEL course on problem solving through programming in C. Students are asked to write a C program to check if a given number is zero, positive, or negative using if/else statements. Sample test cases and outputs are provided. The due date for the assignment has passed. A sample solution is provided by the instructor.

Uploaded by

sdf
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)

[email protected]

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-03 Program-02
Course Due on 2020-02-20, 23:59 IST
outline
Write a C program to check if a given Number is zero or Positive or
Negative Using if...else statement.
How does an
NPTEL online [Week 3 programming assignments will not be considered for final
course work? evaluation]
Week 0 Sample Test Cases
Input Output
Week 1
0
Test Case 1 The number is 0.
Week 2

Week 3 Test Case 2 -0.9 Negative number.

Lecture 11 : Test Case 3 14.05 Positive number.


Assignment
Statement and
Test Case 4 0.45 Positive number.
Operators in C
(unit?
unit=4&lesson=25) Test Case 5 -50 Negative number.

Lecture 12 :
Arithmetic The due date for submitting this assignment has passed.
Expressions
As per our records you have not submitted this assignment.
and Relational
Sample solutions (Provided by instructor)
Expressions
(unit? 1 #include <stdio.h>
2 int main()
unit=4&lesson=26) 3 {
4 double number;
5 scanf("%lf", &number);
6 /* The number is entered automatically from the test cases and exec

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

Lecture 13 :
7 /* Write the rest of the code in the box below
8 As the output should exactly match with the output mentioned in the
Logical 9 so copy and paste the following printf statements wherever and whic
Operators and 10 printf("The number is 0.");
Change in
11 printf("Negative number.");
12 printf("Positive number.");
Control Flow 13 Do not use any other scanf statements */
(unit? 14
unit=4&lesson=27)
15 if (number <= 0.0)
16 {
17 if (number == 0.0)
Lecture 14 : 18 printf("The number is 0.");
Use of Logical 19 else
Operators in 20 printf("Negative number.");
21 }
Branching 22 else
(unit? 23 printf("Positive number.");
unit=4&lesson=28) 24 }
25
Lecture 15 :
Branching : IF -
ELSE
Statement
(unit?
unit=4&lesson=29)

Quiz :
Assignment 3
(assessment?
name=102)

Week-03
Program-01
(/noc20_cs06/progassignment?
name=105)

Week-03
Program-02
(/noc20_cs06/progassignment?
name=106)

Week-03
Program-03
(/noc20_cs06/progassignment?
name=107)

Week-03
Program-04
(/noc20_cs06/progassignment?
name=108)

Feedback For
Week 3 (unit?
unit=4&lesson=114)

Week 4

Week 5

Week 6

Week 7

Week 8

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

Week 9

Week 10

Week 11

Week 12

DOWNLOAD
VIDEOS

Assignment
Solution

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

You might also like