Saturday, June 23, 2018

PROJECT WORK OF COMPUTER

QBasic program

1.   WAP to input any number and check whether the given no. Is divisible by 3 and 7 or not using function procedure.

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 NO IS NOT DIVISIBLE BY 3 AND 7"
END IF
END



2.   WAP to input any number and check whether the given no is positive or negative.

CLS
INPUT"ENTER ANY NUMBER";N
IF N>0 THEN
PRINT"THE GIVEN NUMBER IS POSITIVE"
ELSE IF N<0 THEN
PRINT"THE GIVEN NUMBER IS NEGATIVE"
END IF
END


3.   WAP 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.   WAP to enter any two numbers and display any one.

CLS
INPUT"ENTER ANY TWO NUMBER";A,B
IF A< B THEN
PRINT "THE SMALLEST NUMBER IS ";A
ELSE
PRINT"THE SMALLEST NUMBER IS";B
END IF
END


5.   WAP to enter any three numbers and display the middle number.

CLS
INPUT"ENTER ANY THREE NUMBER";A,B,C
IF A>B AND A<C OR A>C AND A<B THEN
PRINT"THE MIDDLE NUMBER IS";A
ELSEIF B>A AND B<C OR B>C AND B<A THEN
PRINT"THE MIDDLE NUMBER IS";B
ELSE
PRINT"THE MIDDLE NUMBER IS";C
END IF
END


6.    WAP to test whether a user input no is completely divisible by 13 or not.

CLS
INPUT"ENTER ANY NUMBER";N
IF N MOD 13=O THEN
PRINT"THE GIVEN NUMBER IS DIVISIBLE BY 13"
ELSE
PRINT"THE GIVEN NUMBER IS NOT DIVISIBLE BY 13"
END IF
END


7.    WAP to define a function procedure which returns whether a input no is positive, negative or zero.

CLS
INPUT"ENTER ANY NUMBER"N
IF N>0 THEN
PRINT"NUMBER IS POSITIVE"
ELSEIF N<0 THEN
PRINT"NUMBER IS NEGATIVE"
ELSE
PRINT"NUMBER IS ZERO"
END IF
END


8.   WAP to input a year and display whether that year is leap year or not.

CLS
INPUT"ENTER YEAR";Y
IF Y MOD 4=0 AND IF Y MOD 100<>0  OR Y MOD 400=0 THEN
PRINT"THE GIVEN YEAR IS LEAP YEAR"
ELSE
PRINT"THE GIVEN YEAR IS NOT LEAP YEAR"
END IF
END


9.   Input the age of a person and find out whether the person id eligible to drive or not.

CLS
INPUT"ENTER YOUR AGE";A
IF A>= 16 THEN
PRINT"YOU ARE ELIGIBLE TO VOTE"
ELSE
PRINT"YOU ARE NOT ELIGIBLE TO VOTE"
END IF
END


10.        WAP to enter any three no and display the greatest one using sub procedure.

CLS
INPUT"ENTER THREE NUMBER";A,B,C
IF A>B AND A>C THEN
PRINT"THE GREATEST NUMBER IS";A
ELSEIF B>A AND B>C THEN
PRINT"THE GREATEST NUMBER IS";B
ELSE
PRINT"THE GREATEST NUMBER IS";C
END IF
END

Saturday, December 16, 2017

Hiking to Dhadhing

Hiking to Dhadhing
(2074)


In this winter our school planned to take grade 8 student to tour to dhadhing. It was on 16th and 17th of Mangsir. The tour was for one night and two days. But I didn't went to tour because my parents didn't sent me. And it was a heart breaking moment. I felt so bad that I could't go. I didn't did anything that special that day But I felt really bad. In the end of the day I felt a bit better. Another day, I helped my little sister to do her homework, after that I helped my parents to make yamari and other various types of food .After making yamari all the guest arrived at our house. All the food were prepared and we served them the foods they all told that the yamari were tasty. We made various kind of shape in yamari. And after that I played games with my big brother. And I forgot that we had tour. At last we played games upto late night and had lots of fun. The day went good and well.

Thursday, September 7, 2017

QBASIC

1)     Write a program that asks marks in any subject and display the message “Result Pass” if the input number is greater than 40.



CLS
INPUT “Enter marks in computer”; C
IF C>= 40 THEN PRINT “Result Pass”
ELSE PRINT “Result fail”
END



2)     Write a program that asks any two number and display the greater one.



CLS
INPUT “Enter first number”; A
INPUT “Enter second number”; B
IF A>B THEN
PRINT “The greater number is”; A
ELSE
PRINT “The greater number is”; B
END IF
END



3)     Write a program that checks whether the supplied number is odd or even.



CLS
INPUT “Enter any number”; N
IF N MOD 2= 0 THEN
PRINT “Even number”
ELSE
PRINT “Odd number”
END IF
END



4)     Write a program that asks any two number and displays the difference between greater and smaller one.



CLS
INPUT “Enter first number”; A
INPUT “Enter second number”; B
IF A>B THEN
D= A-B
ELSE
D= B-A
END IF
PRINT “Difference of greater and smaller number =”; D
END



5)     Write a program that asks your age and tells whether you are eligible  to  vote or not. ( A person who is 18 years old or above is eligible to vote.



CLS
INPUT “Enter your age”; A
IF A>= 18 THEN
PRINT “You are eligible to vote”
ELSE
PRINT “You are not eligible to vote”
END IF
END



6)     Write a program to print the smallest number among 3 input numbers.



CLS
INPUT “Enter any three number”; a, b, c
IF A<B AND A<C THEN
PRINT “The smallest number is”; A
ELSE IF B<A AND B<C THEN
PRINT “smallest number is”; B
ELSE
PRINT “smallest number is”; C
END IF
END



7)     Write a program that asks marks in 3 different subjects and display message pass or fail. ( The  pass marks for each subjects is 40.



CLS
INPUT “Enter marks in three subjects”; a, b, c
IF A>= 40 AND B>= 48 AND C>=40 THEN
PRINT “you are pass”
ELSE
PRINT “You are fail”
END IF
END



8)     Write a program using FOR……. NEXT statement to print natural numbers up to 15.



CLS
FOR I= 1 TO 15
PRINT I
NEXT I
END



9)     Write a program using FOR…… NEXT statement to print even numbers from 2 to 20.



CLS
FOR I= 2 TO 20 STEP 2
PRINT I
NEXT I
END



10) Write a program using WHILE…… WEND statement to print first 10 odd numbers.



CLS
FOR I = 1 TO 20 STEP 2
PRINT I
NEXT I
END



11)  Write a program using DO WHILE……. LOOP statement to generate numbers 2, 5, 8, 11…, 32.    



CLS
FOR I = 2 TO 32 STEP 3
PRINT I
NEXT I
END



12)  Write a program to print numbers; 100, 95, 90…,5 using any one of the looping structure.



CLS
FOR I = 100 TO 5 STEP -5
PRINT I
NEXT I
END



13)  Write a program to print sum of first 15 natural numbers using any one of the looping structures.



CLS
FOR I = 1 TO 15
S = S+I
NEXT I
PRINT “sum=”; S
|END  



14)  Write a program to print sum of even number from 2 to 10 using any one of the looping structures.



CLS
FOR I = 2 TO 10 STEP 2
S = S + I
NEXT I
PRINT “Sum=”; S
END



15)  Write a program to print sum of odd numbers between 2 to 21 using any one of the looping structures.



CLS
FOR I = 1 TO 21 STEP 2
S = S + I
 NEXT I
PRINT “Sum=”; S
END



16)  Write a program to print even numbers from 20 to 40.



CLS
FOR I = 20 TO 40 STEP
PRINT I
NEXT I
END



17)  Write a program to find product of first ten natural numbers.



CLS
P = 1
FOR I = 1 TO 10
P = P*1
NEXT I
PRINT “Product=”; P
END



18)  Write a program to generate multiplication table of input number.



CLS
INPUT “Enter any number”; N
FOR I = 1 TO 10
PRINT N; “X” I; “=”; N*I
NEXT I
END



19) Write a program to print numbers 1, 8, 27…1000.



CLS
FOR I = 1 TO 10
PRINT I^3
NEXT I
END

Experience of Quarantine and SEE canceled

Our SEE was canceled due to the outbreak of Corona Virus (COVID-19). It's been 3 months since the Nepalese people have been staying home...