22) C PROGRAM TO CHECK NUMBER IS PRIME OR NOT
LOGIC:- A number which divide by 1 and itself is known as prime number.So in program we divide the number starting from 2 and last divisor is original number. If number is divisible by between 2 and number is not a prime number.So for doing this program, we need a loop and modulus operator.
EXAMPLE:-
DISPLAY PRIME NUMBER BETWEEN TWO INTERVALS:
LOGIC:- A number which divide by 1 and itself is known as prime number.So in program we divide the number starting from 2 and last divisor is original number. If number is divisible by between 2 and number is not a prime number.So for doing this program, we need a loop and modulus operator.
EXAMPLE:-
DISPLAY PRIME NUMBER BETWEEN TWO INTERVALS:
Comments
Post a Comment