Week-03 Program-02: (Https://swayam - Gov.in)
Week-03 Program-02: (Https://swayam - Gov.in)
(https://swayam.gov.in) (https://swayam.gov.in/nc_details/NPTEL)
(course)
Announcements (announcements)
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
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