Computer Science, asked by sgarg12092000, 1 year ago

write an algorithm to check whether a number is greater than 0 or not

Answers

Answered by agrawaldevashish63
2

void main(int n) / number to be inputted

{

int x=0;

if(n>x)

System.out.println("number is greater than 0");

else

System.out.println("number is not greater than 0");

}


sgarg12092000: algorithm bta dijye not program
Answered by shubham8190
0
menuhomesearch

Algorithm in Programming

In programming, algorithm is a set of well defined instructions in sequence to solve the problem.

Qualities of a good algorithm

Input and output should be defined precisely.Each steps in algorithm should be clear and unambiguous.Algorithm should be most effective among many different ways to solve a problem.An algorithm shouldn't have computer code. Instead, the algorithm should be written in such a way that, it can be used in similar programming languages.Algorithm ExamplesAlgorithm to add two numbersAlgorithm to find the largest among three numbersAlgorithm to find all the roots of quadratic equationAlgorithm to find the factorialAlgorithm to check prime numberAlgorithm of Fibonacci series

Similar questions