Tuesday, 28 May 2024

Conditional Programs

 (ii) Conditional Programs

Program-11 Write QBASIC Program to find the greater number || smaller among two different numbers.

(11-A) Write a QBASIC program to find the greater number among any two different numbers.

Program-12 Write QBASIC Program to that asks three number and display the greatest || smallest one.


  (12-A) Write a QBASIC program to find the greatest number

  among any three different numbers.

Answer:

CLS

INPUT "Enter three numbers ";A,B,C

IF A>B AND A>C THEN

    PRINT A; " is greatest number. "

    ELSEIF B>A AND B>C then

    PRINT B; " is greatest number. "

    ELSE

    PRINT C;" is greatest number. "

END IF

END  

(12-B) Write a QBASIC program to find the smallest number 

among any three different numbers.

Answer:

CLS

INPUT "Enter three numbers ";A,B,C

IF A<B AND A<C THEN

PRINT A; " is smallest number. "

    ELSEIF B<A AND B<C then

    PRINT B; " is smallest number. "

    ELSE

    PRINT C;" is smallest number. "

END IF

END

Program-13 Write QBASIC Program to that asks three different numbers and display the middle number.

CLS

INPUT "Enter three numbers ";A,B,C

IF (A>B AND A<C) OR (A<B AND A>C)THEN

    PRINT A; " is middle number. "

ELSEIF (B>A AND B<C) OR (B<A AND B>C) THEN

    PRINT B; " is middle number. "

ELSE

    PRINT C;" is middle number. "

END IF

END

Program-14 Write QBASIC Program to test given number is divisible by 7 or not.

CLS

INPUT "Enter a number ";N

R = N MOD 7

IF R=0 THEN

    PRINT N; " is divisible by 7" 

    ELSE

    PRINT N; " is not divisible by 7" 

END IF

END

Program-15 Write QBASIC Program to test given number is odd or even.

CLS

  INPUT "Enter a number ";N

  R = N MOD 2

  IF R=0 THEN

      PRINT N; " is even number " 

  ELSE

      PRINT N;" is odd number " 

  END IF

  END

Program-16 Write QBASIC program to INPUT mark of computer science and check whether student is pass or fail where pass mark is 40.

CLS

  INPUT "Enter mark of computer ";C

  IF C>=40 THEN

      PRINT "Pass "

  ELSE

      PRINT "Fail"

  END IF

  END

Program-17 Write QBASIC program to test whether the entered number is positive, negative or zero.

CLS

  INPUT "Enter a number ";N

  IF N>0 THEN

      PRINT "Positive "

  ELSEIF N<0 THEN

    PRINT "Negative" 

  ELSE

      PRINT "Zero"

  END IF

  END

Program-18 Write QBASIC program to ask CP and SP and test for profit or loss.

CLS

 INPUT "Enter CP and SP";CP,SP

 IF SP>CP THEN 

 P=SP-CP 

 PRINT "Profit=";P 

 ELSE

 L=CP-SP

 PRINT "Loss=";L

 End IF

 END

Program-19 Write QBASIC program to check whether the given year is leap year or not.

CLS

INPUT "ENTER A YEAR",Y

IF Y MOD 4=0 AND Y MOD 100<>0 OR Y MOD 400=0 THEN

PRINT "LEAP YEAR"

ELSE

PRINT "NOT LEAP YEAR"

END IF

END

Program-20 Write QBASIC menu driven program that inputs two numbers and perform the following operations according to user's choice:

1. Sum 2. Difference 3. Product 4. Division

CLS

PRINT "Main-Menu"


PRINT "1. Sum"


PRINT "2. Difference"


PRINT "3. Product"


PRINT "4. Division"


INPUT "Enter two numbers "; a,b

INPUT "Enter your choice"; CH

SELECT CASE CH

    CASE 1: 

        s = A + B

        PRINT "Sum=";s

        CASE 2:

        d = A - B

        PRINT "Difference=";d

        CASE 3:

        p = A * B

        PRINT "Product=";p

        CASE 4:

        div = A / B

        PRINT "Division=";div

        CASE ELSE

        PRINT "Wrong Choice"


End SELECT

END

(iii) Looping Programs

Program-21 Write QBASIC program to display first ten natural numbers.

CLS

  FOR I = 1 TO 10

  PRINT I

  NEXT I 

  END

Program-22 Write QBASIC program to display 10,9,8,...1.

CLS

 FOR I = 10 TO 1 STEP-1 

 PRINT I 

 NEXT I 

 END

Program-23 Write QBASIC program to display first twenty even numbers.

CLS

 A=2

 FOR I = 1 TO 20 

 PRINT A

 A=A+2 

 NEXT I 

 END

Program-24 Write QBASIC program to PRINT the factorial of given number.

[The product of a given positive integer multiplied by all lesser positive integers: The quantity five factorial (5!) = 5 x 4 x 3 x 2 x 1 = 120.]


INPUT "Enter a number"; N

F=1

FOR I = N TO 1 STEP -1

    F = F * I

NEXT I

PRINT "Factorial of " ; N; " = "; F

END

Program-25 Write QBASIC to PRINT multiplication of 5 || 'N' number.


  (25 A) Write QBASIC Program to PRINT multiplication table of 5 .


CLS

FOR I = 1 TO 10 STEP 1

    ANS = 5 * I

    PRINT ANS

NEXT I

END  


(25 B) Write QBASIC Program to PRINT multiplication table of "N" .

CLS

INPUT "Enter a number"; N

FOR I = 1 TO 10 STEP 1

    ANS = N * I

    PRINT ANS

NEXT I

END

Program-26 Write QBASIC program to PRINT sum of first ten natural numbers.

CLS

Sum = 0

For I = 1 to 10

    Sum = Sum + I

Next I

PRINT "Sum of first ten natural numbers = "; Sum

END

Program-27 Write QBASIC program to PRINT factors of given number.

CLS

INPUT "Enter a number ";N

For I = 1 to N

    IF N MOD I = 0 Then PRINT I

Next I

END

Program-28 Write QBASIC program to PRINT sum of digits of entered number. [e.g. 123=1+2+3=6]

CLS

INPUT "Enter a number ";N

Sum = 0

While N<>0

    R = N MOD 10

    Sum = Sum + R

    N = N \ 10

Wend

PRINT "Sum of digits of entered number =";Sum

End 

Program-29 Write QBASIC program to PRINT the product of digits of entered number. [e.g. 123=1*2*3=6]

CLS

INPUT "Enter a number ";N

pro = 1

While N<>0

    R = N MOD 10

    pro = pro * R

    N = N \ 10

Wend

PRINT "Product of digits of entered number =";pro

END

Program-30 Write QBASIC program to reverse given number. [e.g. 123=321]

CLS

INPUT "Enter a number ";N

While N<>0

    R = N MOD 10

    rev = rev * 10 + R

    N = N \ 10

Wend

PRINT "Reverse of given number =";rev

END

Program-31 Write QBASIC program to reverse a given string. [e.g. PLK=KLP]

CLS

INPUT "Enter any string ";W$

FOR I= LEN(W$) TO 1 STEP-1

    C$ = C$ + MID$(W$, I, 1)

NEXT I

PRINT "Reverse of given string= ";C$

END

Program-32 Write QBASIC program to display 100,95,90,.... upto 10th terms.

CLS

A = 100

FOR I= 1 TO 10

PRINT A

    A = A - 5

NEXT I

END

Program-33 Write QBASIC program to display 1,4,9,.... upto 10th terms. Hint: (1*1=1), (2*2=4), (3*3=9),(4*4=16),...

CLS

FOR I= 1 TO 10

PRINT I^2

NEXT I

END

Program-34 Write QBASIC program to display 1,8,27,64,..... upto 10th terms.

Hint: (1*1*1=1), (2*2*2=8), (3*3*3=27),(4*4*4=64),...

CLS

FOR I= 1 TO 10

PRINT I^3

NEXT I

END

Program-35 Write QBASIC program to display 1,2,4,7,11,.... upto 10th terms.

Hint: 1, (1+1=2), (2+2=4),(4+3=7),...

CLS

A = 1

FOR I= 1 TO 10

    PRINT A

    A = A + I

NEXT I

END

Program-36 Write QBASIC program to display 1,5,9,13,.... upto 10th terms.

Hint: 1, (1+4=5), (5+4=9),(9+4=13),...

CLS

A = 1

FOR I= 1 TO 10

    PRINT A

    A = A + 4

NEXT I

END

Program-37 Write QBASIC program to display 2,5,9,14,.... upto 10th terms.

Hint: 2, (2+3=5), (5+4=9),(9+5=14),...

CLS

A = 2

B = 3

FOR I= 1 TO 10

    PRINT A 

    A = A + B

B=B+1

NEXT I

END

Program-38 Write QBASIC program to display 2,8,15,23,32,.... upto 10th terms. Hint: 2, (2+6=8), (8+7=15),(15+8=23),(23+9=32),...

CLS

A = 2

B = 6

FOR I= 1 TO 10

    PRINT A

    A = A + B

    B = B + 1

NEXT I

END

Program-39 Write QBASIC program to display 2,8,18,32,.... upto 10th terms. Hint: (1*1*2=2), (2*2*2=8), (3*3*2=18),(4*4*2=32),...

CLS

FOR I= 1 TO 10

    PRINT I^2*2

NEXT I

END

Program-40 Write QBASIC program to display 0,1,1,2,3,5,.... upto 10th terms.[Fibonacci series]

An integer in the infinite sequence 0,1, 1, 2, 3, 5, 8, 13, … of which the first two terms are 0 and 1 and each succeeding term is the sum of the two immediately preceding is called Fibonacci Series.

CLS

A = 0

B = 1

FOR I = 1 TO 10

    PRINT A

    C = A + B

    A = B

    B = C

NEXT I

END

(iv) Looping Programs with Condition

Program-41 Write QBASIC program to display 7,22,11,34,.... upto 10th terms. [Hailstone series]

Start with any integer value greater than 0, say x. If x is even, then the next value in the series is x/2; if x is odd, then the next value in the series is 3x + 1. This type of series is called Hailstone series.

CLS

N = 7

FOR I = 1 TO 10

    PRINT N

    IF N MOD 2 = 0 THEN

        N = N / 2

        ELSE

        N = 3 * N + 1

    END IF

NEXT I

END

Program-42 Write QBASIC program to test whether the given number is prime or composite number.

[A number that is divisible by itself and 1 is called prime number. (e.g. 2,3,5,7,11 etc)]

CLS

INPUT "Enter a number"; N

C = 0

FOR I = 1 TO N STEP 1

    R = N MOD I

    IF R=0 THEN C=C+1

NEXT I

IF C=2 THEN

    PRINT N;" is prime number"

    ELSE

    PRINT N;"is composite number"

END IF

END

Program-43 Write QBASIC program to display prime numbers from 1 to 100.

CLS

 FOR N = 1 TO 100

    C = 0

    FOR I = 1 TO N STEP 1

        R = N MOD I

        IF R=0 THEN C=C+1

    NEXT I

IF C=2 THEN PRINT N;

NEXT N

END

Program-44 Write QBASIC program to test whether the given number is palindrome or not.

A word, phrase, or sequence that reads the same backwards as forwards is called Palindrome. Example : 121 , 101 etc

CLS

INPUT "Enter a number"; N

A = N

WHILE N<>0

    R = N MOD 10

    REV = REV * 10 + R

    N = N \ 10

WEND

IF A=REV THEN

    PRINT A;" is Palindrome Number"

    ELSE

    PRINT A;"is not Palindrome Number"

END IF

END

Program-45 Write QBASIC program to check whether the entered number is Armstrong number or not.

An Armstrong number is an n-digit base b number such that the sum of its (base b) digits raised to the power n is the number it self. Hence 153 is Armstrong Number because 13+53+33=1+125+27=153,370,371,407.

CLS

INPUT "Enter a number"; N

A = N

WHILE N<>0

    R = N MOD 10

    SUM = SUM + R * R * R

    N = N \ 10

WEND

IF A=SUM THEN

    PRINT A;"is Armstrong Number"

    ELSE

    PRINT A;"is not Armstrong Number"

END IF

END

Program-46 Write QBASIC program to display Armstrong number from 1 to 1000.[Hint: 1,153,370,371,407 are Armstrong Number].

CLS

FOR I = 1 TO 1000

    SUM = 0

    N = I

    WHILE N<>0

        R = N MOD 10

        SUM = SUM + R * R * R

        N = N \ 10

    WEND

    IF I=SUM THEN PRINT I

NEXT I

END

Program-47 Write QBASIC program to count the total number of vowels in a given string.

CLS

INPUT "Enter any string ";W$

W$ = UCASE$(W$)

FOR I= 1 TO LEN(W$)

    C$ = MID$(W$, I, 1)

    SELECT CASE C$

        CASE "A","E","I","O","U"

        C = C + 1

    END SELECT

NEXT I

PRINT "Number of vowels=";C

END

Program-48 Write QBASIC program to count the total number of consonants in a given string.

CLS

INPUT "Enter any string ";W$

W$ = UCASE$(W$)

FOR I= 1 TO LEN(W$)

    C$ = MID$(W$, I, 1)

    SELECT CASE C$

        CASE "A","E","I","O","U"

        CASE ELSE

            C = C + 1

    END SELECT

NEXT I

PRINT "Number of consonants=";C

END

Program-49 Write QBASIC program to check whether the given string is palindrome or not.

CLS

INPUT "Enter any string ";W$

FOR I= LEN(W$) TO 1 STEP-1

    C$ = C$ + MID$(W$, I, 1)

NEXT I

IF W$=C$ THEN

    PRINT "Palindrome String"

    ELSE

    PRINT "Not Palindrome String"

END IF

END

Program-50 Write QBASIC program to count total number of word in a given sentence.

CLS

INPUT "Enter any sentence ";S$

sp = 1

FOR I= 1 TO LEN(S$)

    C$ = MID$(S$, I, 1)

    IF C$=" " THEN sp=sp+1

NEXT I

PRINT "Total words=";sp

END

Program-51 Write QBASIC program to calculate HCF of two numbers.

CLS

 INPUT "Enter two numbers "; A,B

FOR I = 1 TO A

    IF A MOD I = 0 AND B MOD I =  0 THEN

        H = I

    END IF

NEXT I

PRINT "HCF =";H

END

Program-52 Write QBASIC program to calculate LCM of two numbers.

CLS

INPUT "Enter two numbers ";A,B

FOR I = 1 TO A

    IF A MOD I = 0 AND B MOD I = 0 THEN

        H = I

    END IF

NEXT I

LCM = (A * B) / H

PRINT "LCM ="; LCM

END

Nested Loop Patterns

Program-53Write QBASIC program to display:

  1

  1 2

  1 2 3

  1 2 3 4

  1 2 3 4 5

 Answer

 CLS

 FOR I = 1 TO 5

    FOR J = 1 TO I

        PRINT J;

    NEXT J

 PRINT

 NEXT I

END

Program-54 Write QBASIC program to display:

    1

    2 2

    3 3 3

    4 4 4 4

    5 5 5 5 5

Answer:

 CLS

    FOR I = 1 TO 5

    FOR J = 1 TO I

        PRINT I;

    NEXT J

 PRINT

 NEXT I

END

Program-55 Write QBASIC program to display:

  5

  5 4

  5 4 3

  5 4 3 2

  5 4 3 2 1

Answer:

 CLS

 FOR I = 5 TO 1 STEP-1

    FOR J = 5 TO I STEP-1

        PRINT J;

    NEXT J

    PRINT

NEXT I

END

Program-56 Write QBASIC program to display:

  1 1 1 1 1

  2 2 2 2

  3 3 3

  2 2

  1

Answer:

 CLS

 FOR I = 1 TO 5

    FOR J = 5 TO I STEP-1

        PRINT I;

    NEXT J

    PRINT

NEXT I

END

Program-57 Write QBASIC program to display:

  1

  1 3

  1 3 5

  1 3 5 7

Answer:

 CLS

 FOR I = 1 TO 7 STEP +2

    FOR J = 1 TO I STEP +2

        PRINT J;

    NEXT J

    PRINT

NEXT I

END

Program-58 Write QBASIC program to display:

  1

  3 3

  5 5 5 

  7 7 7 7

Answer:

 CLS

 FOR I = 1 TO 7 STEP +2

    FOR J = 1 TO I STEP +2

        PRINT I;

    NEXT J

    PRINT

NEXT I

END

Program-59 Write QBASIC program to display:

  1 2 3

  2 3 4

  3 4 5

  4 5 6

  5 6 7

Answer:

CLS

K=0

FOR I = 1 TO 5

    FOR J = 1 TO 3

        PRINT J+K;

    NEXT J

    PRINT

K=K+1

NEXT I

END

Program-60 Write QBASIC program to display : 1 2 3 6 11 20 37 .... Up to 10th terms.

Answer:

CLS

A = 1

B = 2

C = 3

FOR I = 1 TO 10

    D = A + B + C

    PRINT A

    A = B

    B = C

    C = D

NEXT I

END

Program-61 Write QBASIC program to display : 5,16,8,4,2,1,4,2,1,4.

Answer:

CLS

N = 5

FOR I = 1 TO 10

    PRINT N

    IF N MOD 2 = 0 THEN

        N = N / 2

        ELSE

        N = 3 * N + 1

    END IF

NEXT I

END

Program-61 Write QBASIC program to display : 66666,6666,666,66,6.

Answer:

CLS

  A=66666

  FOR I = 1 TO 5

  PRINT A ;

  A=A\10

  NEXT I

END

Program-62 Write QBASIC program to display : 2,8,18,32,.... up to 10th terms

Answer:

CLS

  FOR I = 1 TO 10

  PRINT I^2*2 ;

  NEXT I

END

Program-63 Write QBASIC program to display : 7,22,11,34,17,52,26,13,40,20.

Answer:

CLS

N = 7

FOR I = 1 TO 10

    PRINT N

    IF N MOD 2 = 0 THEN

        N = N / 2

        ELSE

        N = 3 * N + 1

    END IF

NEXT I

END

SET 1

 Group 'A'

1. Answer the following questions in one sentence: [ 6x1=6]

a What is analog signal?

Ans: An analog signal refers to a continuous electrical signal that varies over time and represents data as a continuous waveform. trical sign

b. What is cyber Law?

Ans: The law which governs the legal issues in the cyber space regarding the internet or WWW for digital data processing and transaction is called cyber law.

c. What is information security?

Ans: Information security is the practice of preventing unauthorized access, use, disclosure, modification, recording or destruction of information.

d. What is online payment?

Ans: Online payment refers to the payment for buying goods or services through the Internet using different online payment gateway.

What is primary key?

Ans: A primary key is a field or combination of fields in a table that uniquely identifies each record, and is used to establish relationships between tables and enforce data integrity.

f. Define validation text.

Ans: Validation Text is a field property which displays an error message that appears if the data entered is invalid according to the specified validation rule.


2. Write appropriate technical term for the following: [2x1=2]

a. It is the process of converting plain text to cipher text. Encryption

b. Software require for browsing and surfing content on the WWW. Web Browser


3. Write the full form of the following:

a VOIP-Voice Over Internet Protocol

b. IOT-Internet of Things


Group 'B'[9x2=18]

4. Answer the following questions:[2x1=2]

a. What is computer network? Write any two advantages advantages of it.

Ans: Computer network is a group of two or more computers and devices connected to each other through wired or wireless media to exchange data and information and share hardware, software and other resources.

Any two advantages of Computer Network are

1. A network connected computers can share hardware devices such as scanner, printer, hard disk, etc.

2. It can communicate and share information all over the world through Internet.

b. Define social media with its any two opportunities.

Ans: Social Media is an online tool that helps us to stay connected with the whole world.

Any two opportunities of using social media

a) It creates awareness and innovate the way people live

b) Social media let us share anything with others around the world.

C What is E-commerce? Explain in short.

Ans: E-commerce refers to the buying and selling of goods or services using the internet. E.g. Amazon, Flipkart, eBay, sastodeal, daraz etc. The main goal of e- commerce is to reduce cost, faster customer response and deliver the better quality service. It makes buying/selling possible 24/7. There are no geographical boundaries for e-business. Anyone can order anything from anywhere at any time.



d. What is firewall? Write its any two uses.

A firewall is the network security systems that monitors and controls the traffic flow between the Internet and private network on the basis of a set of user- defined rules.

Any two uses of firewall are:

Firewalls act as a barrier between an internal network and external networks (like the internet). By filtering traffic, they help safeguard sensitive data and critical resources within the network.

Firewalls enforce access control policies by allowing or denying specific types of traffic based on criteria such as IP addresses, ports, protocols, and packet contents.

e Define virtual reality with its characteristics.

An artificial environment created with computer hardware and software and presented to the user in such a way that it appears and feels like a real environment.

The characteristics of virtual reality are:

VR Gaming allows players to immerse (dip) themselves in virtual world and interact with environment and characters

VR can help students learn by making the content more engaging and memorable.

f. Differentiate between database and DBMS.

database

DBMS

A collection of systematically organized inter-related data is called a database. The purpose of data base is to store, organize and retrieve data.

DBMS is a computerized system that stores data, processes them and provides information in an organized form.

E.g. Dictionary, Marks Ledger, Telephone Directory, Attendance Register etc.

E.g. MS-Access, Oracle, MySQL, Fox Pro etc.

g. What is data type? List any four types of data types used in MS-Access. Data type is an attribute for a field that determines the type of data that can be stored in that field.

any four types of data types used in MS-Access are Text, Date/Time, Currency, Yes/No



h. Define term sorting and filtering.

The process of arranging all the records in a table either ascending or descending order based on field or fields is known as sorting.

Filtering is the process of viewing required record of a table that matches the specifies criteria.

i. Define Table. Why caption field property is used in MS-Access?

Tables are the primary building block of database which stores and manages large volume of data into rows and column.

Caption is a field property which gives alternative name given for any field. The maximum size for this is 2048 characters.

5. Write down the output of the given program. Show with dry run in table: [2]

DECLARE SUB SERIES(X)

CLS X=7 CALL SERIES(X) END

SUB SERIES(X) FOR M1 TO 10 PRINT X:

IF X MOD 2-0 THEN X=X/2



6. Re-write the given program after correcting the bugs:

CREATE FUNCTION SQUARE(N)

CLS REM TO PRINT SQUARE OF A NUMBER GET "ENTER ANY NUMBER"; N CALL SQUARE(N) END

FUNCTION SQUARE(N) ANS=A^2 SQUARE = ANS END SQUARE(N)

Debugged Program

DECLARE FUNCTION SQUARE(N)

CLS REM TO PRINT SQUARE OF A NUMBER INPUT "ENTER ANY NUMBER"; N PRINT SQUARE(N)

END

By : D

FUNCTION SQUARE(N)

ANS-N^2 SQUARE ANS

END FUNCTION epared

7. Study the following program and answer the given questions: [2]

DECLARE FUNCTION OUTPUTS(WS)

CLS

WS="CYBER CRIME"

PRINT OUTPUTS (WS)

END



FUNCTION OUTPUTS (WS) FOR M= LEN(WS) TO 1 STEP-2

MS-MS+MIDS(WS, M, 1)

NEXT M

OUTPUTS-MS

END FUNCTION

a Why is $ sign is followed by function name?

Ans: The $ sign is followed by function name because the function returns string value.

b. List the library function used in the above program.

Ans: The library function used in the above program are LEN() )and MID$().

Group 'C'

8. Convert/calculate as per the instruction: [4x1=4]

a (ABC)16 into (2)10

b (143) into (?)2

c. (1010)+(1100)x(1011)

d. (110111001)+(101)

9. Write a program to define a sub procedure to display the reverse of string input by user. And define function procedure to find out volume of cylinder where the necessary data has to be fed in main module. [Hint volume of Cylinder-RH] [4]

DECLARE SUB REV(AS)

DECLARE FUNCTION VOL(R, H)

CLS

INPUT "Enter any string"; AS

INPUT "Enter radius"; R INPUT "Enter Height"; H

CALL REV(AS)

PRINT "Volume of Cylinder="; VOL(R, H)

END

SUB REV(AS)

FOR I=LEN(AS) TO 1 STEP-1 BS-MIDS(AS, I, 1)

CS-CS+BS

NEXT I

PRINT "Reversed String is"; CS

END SUB

FUNCTION VOL(R, H)

VOL-22/7*R^2*H

END FUNCTION



10. A sequential data file "INFO.INF" has numerous records with name, address and telephone number in each record. Write a program to scan all the records from that file and display only the records whose address is "TANSEN" [4]

OPEN "INFO.INF" FOR INPUT AS #1

CLS

WHILE NOT EOF(1)

INPUT #1, N$, AS, T

IF UCASES(AS)="TANSEN" THEN PRINT NS, AS, T

WEND

CLOSE #1

END

11. Write a program in c language to ask a number and check whether it is odd or even.

#include<stdio.h>

#include<conio.h>

int main()

{

int n;

printf("Enter any number: ");

scanf("%d", &n);

if(n%2-0)

printf("%d is even number", n);

else

printf("%d is odd number", n);

return 0;

}

Write a program in c language to display series 1,1,2,3,5 up to 13 terms [4] 

OR

#include<stdio.h>

#include<conio.h>

int main()

{

int a,b,c,i;

a=1;

b=1:

for(i=1;i<=10;i++)

{

printf("%d \n", a);

c=a+b;

a=b;

b-c;

return 0;

}

}


Exercise 1

 1. Write very short answers to the following questions:

a. Define a computer network.

b. What is a simplex transmission mode?

C. What is half duplex transmission mode?

d. Write any two advantages of a computer network.

e. Write any two disadvantages of a computer network.

f. Write any two threats to the computer network.

g. Write any two characteristics of a local area network.

h. List any two features of a metropolitan area network.

i. Write any two features of a wide area network.

j. What is bandwidth?

k. Write any two advantages of a client-server network architecture.

1. What are the two disadvantages of a client-server network?

m. List any two features of a peer-to-peer network architecture.

n. Make a figure to illustrate a peer-to-peer network architecture.

0. Make a figure to explain and demonstrate a client-server network architecture.

p. Why the star topology is popular write in two points.

q. Write any two disadvantages of a ring topology.

г. Define the internet in a sentence.

S. Write about the intranet in a sentence.

t. Write two examples of web browsers.

u. Write any two popular email service providers' names.

v. What is a search engine?

w. Write the name of any two search engines.

x. Write any two advantages of e-mail.

y. What is a download?

z. What is an upload?

aa. What is the chat?

ab. Write about the URL.

ac. Write the URL of the website you like most.

ad. Write the technical term to describe cloud computing.

ae. Write the technical term to describe the IoTs.

2. Answer the following questions:

a. What is a computer network, and why is it essential in modern computing?

b. Define the term "data transmission" in the context of computer networks.

C. What are the primary purposes of computer networks?

d. Explain the difference between a LAN and a WAN in the context of computer networks.

e. How does a computer network enable resource sharing among connected devices?

f. What is the significance of network security in computer networks?

g. Describe the difference between simplex, half-duplex, and full-duplex data transmission modes.

h. When would you use simplex transmission in a computer network?

i. What is a Local Area Network (LAN), and what are its typical use cases?

j. Describe a Wide Area Network (WAN) and provide examples of WAN

technologies.

k. What is a Metropolitan Area Network (MAN), and how does it differ from LAN and WAN?

1. Define an Intranet and an Extranet, and highlight their differences.

m. How does full-duplex data transmission differ from half-duplex, and where

is it commonly used? n. What is network architecture, and why is it important in network design?

o. Compare and contrast the client-server and peer-to-peer network architectures.

p. Define network topology and describe the most common types, such as bus, star, and ring.

q. Discuss the advantages and disadvantages of each network topology.

г. Define bandwidth? How it is measured?

s. What is a network protocol, and why is it essential for network communication?

t. Provide examples of widely used network protocols and describe their specific purposes.

3. Fill in the blanks:

a. A computer network is a set of interconnected resources and information. that can share

b. One of the primary purposes of computer networks is to facilitate between devices.

C. A LAN stands for localized environment. Area Network and is typically used in a

d. In transmission mode, data flows in one direction only.

e. Full-duplex transmission allows data to flow in

directions

simultaneously. f. A connects computers within a limited geographic area, like a

home or office.

g. A connects computers over a larger geographic area, often across cities or countries.

h. In a client-server architecture, resources from a central server. devices request services or

i. In a peer-to-peer architecture, devices are considered share resources directly. and can

j. Ina network, all devices are connected to a single central cable.

k. star network topology has all devices connected to a central

1. A is a set of rules and conventions that govern how data is formatted and transmitted on a network.

m. HTTP and FTP are examples of application-layer

4. Write the technical term for the following:

a. Transmission of text, audio, video through some electronic means.

b. Data transmission only in one direction.

c. Transmission of data in both direction but only one way at a time.

d. Transmission of data in both directions simultaneously at a same time.

e. Interconnection between two or more than two computers.

f. Smallest type of computer network.

g. Largest computer network.

h. Network of network.

i. Privately owned network of network.

j. Physical structure of computer network.

k. Document prepared by markup language.

1. Device used to connect a PC with a telephone line. m. A network limited with a room or building.

n. The computer on which users run applications.

0. Cabling structure of LAN.

p. Each computer or device on a network.

q. A device that controls two dissimilar networks.

г. The amount of data that can be transmitted through communication channels in a fixed time period.

s. A server where incoming emails are collected in mailbox.

t. A computer that provides services to other computers.

u. Operating system that can handle network.

v. A cable that transmits light signals.

w. The process of sending and receiving data and information between two or

more than two person.

x. Transmission of data or information that can take place in only one direction.

y. Basic componentsrequired to make data communication.

z. Wire is made up of copper and a pair of wires are twisted together and insulated with plastic.

aa. Cable is made up of copper or aluminium wire with an inner conductor surrounded by insulating layer and again surrounded by conducting shield.

ab. Cable uses light wave to carry data signal from one end of cable to other end.

ac. Radio signal for receiving and transmitting electronic data.

ad. High frequency wave which is used to transfer signals through atmosphere.

ae. Two or more than two computers connected to each other through wire of wireless media to share data or information, hardware, software and other resources.

af. Provides a port on the back of system unit to connect a computer in network. ag. An important software which controls and manages computer network.

ah. A set of rules followed for interconnection and communication between computers in a network.

ai. Defines how the computer communicates and interacts with each other on network.

aj. Inter-connected pattern of network components.

ak. Connection of two or more computers to share information.

al. Sending and receiving messages electronically through the Internet.

am. Buying and selling of goods, products, or services over the Internet.

an. The websites that search documents for specified keywords in Www.

ao. A port on the back of the system unit to connect a computer in network.

5. Write the full form of:

a. LAN

b. MAN

C. WAN

d. INTERNET

e. INTRANET

f. STP

g. UTP

h. BNC

i. RJ-45

j. SMPT

k. FTP

1. TCP/IP

m. VOIP

n. ADSL

0. DSL

p. IPX/SPX

q. ARPANET

г. SMA

s. NIC

u. WWW

w. URL

y. ATM

aa. E-fax

t. MODEM

V. POP

Χ. ISP

Z. E-mail

ab. E-commerce

MCQ Question Bank Microsoft PowerPoint