Find us on Facebook

Thursday, December 13, 2018

Check if the number is positive or negative or zero



Aim: Implement a program to check if the number is positive or negative or zero
Algorithm:
1.Start
2. Read Num
3.Is Num > 0 
4.Print “Positive”
5.Else if  Num<0
6.Print “Negative”
7.Else  Print “Zero
8.Stop

Program:
num = float(input("Enter a number: "))
if num > 0:
   print("Positive number")
elif num == 0:
   print("Zero")
else:
   print("Negative number")

Output :
Enter a number: 2
Positive number

0 Comments:

Popular Posts

Text Widget

Search This Blog

Powered by Blogger.

Blogger Pages

Like Canvas?

Sponsor

Footer Widgetized Areas

About Canvas

About Canvas

Subscribe Us

About

Text Widget

Tags

Total Pageviews

print pdf

cal

Most Popular

    TUPLES
 LIST and SLICING
      ASCII VALUE
Copyright © KTU Btech Cse Python Lab Manuals | Powered by Blogger
Design by Saeed Salam | Blogger Theme by NewBloggerThemes.com | Distributed By Gooyaabi Templates