Posts

Showing posts from June, 2018

QBASIC Programs

QBASIC Programs 1. Write a program to input any number and check whether 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 number is divisible by 3 and 7" ELSE PRINT"The number is not divisible by 3 and 7" END IF END 2. Write a program to input any number and check whether the give 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.Write a program to input any number and display whether 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. Write a program to enter any two numbers and display the smaller one. CLS INPUT"Enter any two numbers";A,B IF A<B THEN PRINT"The smallest num