Posts

Showing posts from June, 2018

Qbasic programming

1. Write a program to input any number and check wheather the given number is divisible by 3 and 7 or not.    ClS INPUT “enter any number”;n If n MOD 3=0 and n MOD 7=0 THEN PRINT”The given number is divisible by 3 and 7” ELSE PRINT”The given number is not divisible by 3 and 7” END IF END 2. WAP to input any number and check wheather the given number is positive or negative.       CLS INPUT”Enter any number”;n IF n>0 THEN PRINT “The given number is positive” ELSEIF n<0 THEN PRINT”The given number is negative “ END IF END 3. WAP to input any number and display wheather it is odd or even.      ClS INPUT “ENTER any number”;n IF n MOD 2=0 THEN PRINT “The given number is even” ELSE PRINT “The given number is odd” END IF END 4. WAP to enter any two number and display the smaller one.     CLS INPUT “Enter any two number “;A,B IF A<B THEN PRINT “The smaller number is “;A ELSE PRINT “The smaller number is”;B END IF END 5. WAP to enter 3