Write a program to accept a number and check whether it is a positive or negative
number. BASIC 256 ONLY
Answers
Answered by
0
Answer:
java program to check number is positive or negative :
class a1
{
public static void main ( int n)
{
if( n>0)
System.out.println( "postive");
else
System. out.println( " Negative");
}
}
BASIC program to check number is positive or negative:
10 cls
20 Input"Enter a number"; N
30 If N > 0 then print "positive" else print "negative"
40 End
Algorithm to check number is positive or negative:
Step 1: start
Step 2: input a number as N
Step 3: Check if N is greater that 0 or not
Step 4: If yes then print positive else print negative
Step 5: End
More information:
Algorithm:
An algorithm is a detailed step-by-step instruction set for solving a problem or completing a task.
Flowchart:
A flowchart is a pictorial representation of an algorithm.
BASIC:
A basic is a type of program that we learn before doing java program.
Hope it helps pls mark the answer as brainliest.❤
Similar questions
Math,
21 days ago
Hindi,
1 month ago
Math,
1 month ago
Math,
9 months ago
Computer Science,
9 months ago