Computer Fundamental | MCQ Set-1
Click on the options to select your correct answer. indicates the correct and indicates wrong answer.
Computer Notes, Programming codes, Hardware and Networking Tip, Entertainment, Biography, Internet Tip, Tech News, Latest Technology, YouTube,
Click on the options to select your correct answer. indicates the correct and indicates wrong answer.
CLS s$ = "NEPAL" r = 1 t = 10 FOR i = 5 TO 1 STEP -2 PRINT TAB(t); MID$(s$, r, i) r = r + 2 t = t + 2 NEXT i END
DECLARE SUB pat(a$) CLS a$ = "NEPAL" CALL pat(a$) END SUB pat (s$) r = 1 t = 10 FOR i = 5 TO 1 STEP -2 PRINT TAB(t); MID$(s$, r, i) r = r + 2 t = t + 2 NEXT i END SUB
DECLARE FUNCTION pat$(a$) CLS a$ = "NEPAL" p$ = pat$(a$) END pat$ (s$) a$ = "NEPAL" r = 1 t = 10 FOR i = 5 TO 1 STEP -2 PRINT TAB(t); MID$(s$, r, i) r = r + 2 t = t + 2 NEXT i END FUNCTION
CLS s$ = "1A2b3c" FOR i = 1 TO LEN(s$) FOR j = 1 TO i PRINT MID$(s$, i, 1); NEXT j PRINT NEXT i END
DECLARE SUB pattern(s$) CLS s$ = "1A2b3c" CALL pattern(s$) END SUB pattern (s$) FOR i = 1 TO LEN(s$) FOR j = 1 TO i PRINT MID$(s$, i, 1); NEXT j PRINT NEXT i END SUB
DECLARE FUNCTION pattern$(s$) CLS r$ = pattern$(s$) END FUNCTION pattern$ (s$) s$ = "1A2b3c" FOR i = 1 TO LEN(s$) FOR j = 1 TO i PRINT MID$(s$, i, 1); NEXT j PRINT NEXT i END FUNCTION
import java.util.Scanner; class Rectangle4{ int l, b; void getData(){ Scanner in = new Scanner(System.in); System.out.print("Enter length : "); l=in.nextInt(); System.out.print("Enter breadth : "); b=in.nextInt(); } void displayArea(){ int a; a = l*b; System.out.println("Area = "+a); } public static void main(String args[]){ Rectangle4 obj = new Rectangle4(); obj.getData(); obj.displayArea(); } }
class Demo{ void display(){ System.out.println("Class Example"); } public static void main(String args[]){ Demo obj = new Demo(); obj.display(); } }