Wednesday, 17 September 2025

SEE IMP QUESTIONS C LANGUAGE

 Write a C program to calculate simple interest. The program


should accept the principal amount, rate of interest, and time period as input.

Solution:

C
#include <stdio.h>

int main() {
    float principal, rate, time, simple_interest;

    printf("Enter the principal amount: ");
    scanf("%f", &principal);

    printf("Enter the annual rate of interest (in percentage): ");
    scanf("%f", &rate);

    printf("Enter the time period (in years): ");
    scanf("%f", &time);

    simple_interest = (principal * rate * time) / 100;

    printf("\nSimple Interest = %.2f\n", simple_interest);

    return 0;
}

Question 3: Find the Largest of Three Numbers

Problem: Write a C program to find the largest of three different numbers entered by the user.

Solution:

C
#include <stdio.h>

int main() {
    int num1, num2, num3;

    printf("Enter three numbers: ");
    scanf("%d %d %d", &num1, &num2, &num3);

    if (num1 >= num2 && num1 >= num3) {
        printf("The largest number is: %d\n", num1);
    } else if (num2 >= num1 && num2 >= num3) {
        printf("The largest number is: %d\n", num2);
    } else {
        printf("The largest number is: %d\n", num3);
    }

    return 0;
}

Question 4: Print Numbers from 1 to 10

Problem: Write a C program to print numbers from 1 to 10 using a loop.

Solution:

C
#include <stdio.h>

int main() {
    int i;

    for (i = 1; i <= 10; i++) {
        printf("%d\n", i);
    }

    return 0;
}

Question 5: Calculate Sum and Average

Problem: Write a C program to find the sum and average of two numbers entered by the user.

Solution:

C
#include <stdio.h>

int main() {
    int num1, num2, sum;
    float average;

    printf("Enter the first number: ");
    scanf("%d", &num1);

    printf("Enter the second number: ");
    scanf("%d", &num2);

    sum = num1 + num2;

    average = (float)sum / 2;

    printf("\nSum = %d\n", sum);
    printf("Average = %.2f\n", average);

    return 0;
}

Question 6: Area and Perimeter of a Rectangle

Problem: Write a C program to calculate the area and perimeter of a rectangle. The program should take the length and width as input.

Solution:

C
#include <stdio.h>

int main() {
    float length, width, area, perimeter;

    printf("Enter the length of the rectangle: ");
    scanf("%f", &length);

    printf("Enter the width of the rectangle: ");
    scanf("%f", &width);

    area = length * width;
    perimeter = 2 * (length + width);

    printf("\nArea of the rectangle = %.2f\n", area);
    printf("Perimeter of the rectangle = %.2f\n", perimeter);

    return 0;
}

Question 7: Celsius to Fahrenheit Conversion

Problem: Write a C program to convert temperature from Celsius to Fahrenheit.

Solution:

C
#include <stdio.h>

int main() {
    float celsius, fahrenheit;

    printf("Enter temperature in Celsius: ");
    scanf("%f", &celsius);

    fahrenheit = (celsius * 9 / 5) + 32;

    printf("\nTemperature in Fahrenheit = %.2f\n", fahrenheit);

    return 0;
}

Question 8: Factorial of a Number

Problem: Write a C program to find the factorial of a positive integer entered by the user.

Solution:

C
#include <stdio.h>

int main() {
    int n, i;
    unsigned long long factorial = 1; // Use long long for larger numbers

    printf("Enter a positive integer: ");
    scanf("%d", &n);

    if (n < 0) {
        printf("Factorial is not defined for negative numbers.\n");
    } else {
        for (i = 1; i <= n; ++i) {
            factorial *= i;
        }
        printf("Factorial of %d = %llu\n", n, factorial);
    }

    return 0;
}

Question 9: Check for a Leap Year

Problem: Write a C program to check if a year is a leap year or not.

Solution:

C
#include <stdio.h>

int main() {
    int year;

    printf("Enter a year: ");
    scanf("%d", &year);

    if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0)) {
        printf("%d is a leap year.\n", year);
    } else {
        printf("%d is not a leap year.\n", year);
    }

    return 0;
}

Question 10: Sum of Digits

Problem: Write a C program to find of sum of digits of given number. 

Solution:

C
#include <stdio.h>

int main() {
    int n, sum = 0, remainder;

    printf("Enter an integer: ");
    scanf("%d", &n);

    // Loop continues until n becomes 0
    while (n != 0) {
        remainder = n % 10;
        sum += remainder;
        n /= 10;
    }

    printf("Sum of digits = %d\n", sum);

    return 0;
}

Wednesday, 27 August 2025

COMPUTER SEE SOLVED-2081 PABSON KATHMANDU

Set 2: PABSON 2081 (Set A) Solved 

COMPUTER SCIENCE                                                           F.M 50    

                                                                                                     P.M 17.5                                  

Group 'A'          

a. What is web browser?
 A web browser is an application software used to access and view websites on the internet.

b. What is the business conducted through wireless handheld device?
 Mobile commerce (m-commerce).

c. Which data type is used to video file in MS-Access?
OLE Object / Attachment.

d. What is Filtering?
 Filtering is the process of displaying only the records that meet specific criteria in a database.

e. Write difference between function procedure and sub procedure.
 A function procedure returns a value, whereas a sub procedure does not return a value.

f. Write any two header files of C language.
<stdio.h> and <conio.h>.

Write appropriate technical term                                [2]

a. Copying someone else’s work and publishing as your own.
 Copyright violation.

b. Converting plaintext into ciphertext.
 Encryption.

Write the full form                                                     [2]

a. ASCIIAmerican Standard Code for Information Interchange.
b. MACMedia Access Control.

Group "B" [2 marks × 9 = 18]

a. Define computer network. List the types of computer network.
A computer network is a system that connects two or more computers and other devices together to share data, resources, and services such as files, printers, and internet access. Networking allows communication between users and devices over short or long distances.
The main types of computer networks are:

  • LAN (Local Area Network): Covers a small area such as a school, office, or building.

  • MAN (Metropolitan Area Network): Covers a larger area such as a city or town.

  • WAN (Wide Area Network): Covers a very large geographical area, even worldwide, such as the internet.

b. What is cyber ethics? List any two of them.
 Cyber ethics refers to the moral principles and proper behavior that people should follow while using the internet and digital technology. It guides users on how to act responsibly, respect others, and avoid harmful activities online. Cyber ethics ensures a safe and trustworthy digital environment.
 Two examples of cyber ethics are:

  1. Avoid hacking or spreading viruses – Do not break into others’ systems or damage their data.

  2. Respect privacy – Do not misuse or share someone’s personal information without their permission.

c. What is computer security? Write any two measures of hardware security.
 Computer security is the protection of computer systems, hardware, software, and data from unauthorized access, theft, damage, or misuse. It ensures confidentiality, integrity, and availability of information.
 Two measures of hardware security are:

  1. Physical locks and restricted access – Placing computers in secure rooms and using locks to prevent theft.

  2. Biometric and password protection – Using fingerprints, smart cards, or strong passwords to restrict unauthorized users from operating the system.

d. What is m-computing? Write advantages of m-computing.
 Mobile computing (m-computing) refers to the ability to access data, applications, and services using portable devices such as smartphones, tablets, or laptops while being mobile. It allows users to perform computing tasks without being fixed to a particular location.
 Advantages of m-computing are:

  • Portability: Users can carry devices anywhere and perform tasks on the go.

  • Instant communication and access: It provides quick access to email, internet, and cloud storage.

  • Time-saving: Work can be done from any location, increasing productivity.

e. What is VR? Write two application areas of VR.
 Virtual Reality (VR) is an advanced computer technology that creates a simulated 3D environment where users feel as if they are physically present in that world. By wearing VR headsets or using VR-enabled devices, users can interact with the virtual environment in real time.
 Two application areas of VR are:

  1. Gaming and Entertainment – VR provides realistic experiences in video games and movies.

  2. Medical Training – Doctors and medical students use VR to practice surgery and treatment in a risk-free environment.

f. What is query? List its types.
 A query is a request made to a database in order to search, retrieve, or manipulate specific information. It allows users to display data that meet certain conditions. Queries are one of the most important tools in database management.
 Types of queries are:

  • Select Query: Retrieves specific data from a table.

  • Action Query: Performs actions like update, delete, or append.

  • Parameter Query: Prompts the user for input when run.

  • Crosstab Query: Summarizes data in a tabular format.

g. Define filtering. Write two examples of it.
 Filtering is the process of displaying only those records in a database that match certain criteria while hiding others. It helps in analyzing and managing data more efficiently.
 Examples of filtering:

  1. Showing only students who scored more than 40 marks in English.

  2. Displaying employees who belong to the "IT" department.

h. Define primary key.Write any two advantages of it.
 A primary key is a unique field or combination of fields in a database table that uniquely identifies each record. No two records can have the same primary key value, and it cannot be left empty.
 Advantages of using a primary key:

  1. Prevents duplication: Ensures that every record is unique.

  2. Maintains data integrity: Makes searching and linking data between tables easier and more accurate.

i. What is field and database?
 A field is the smallest unit of data in a database that stores a single piece of information, such as Name, Age, or Roll Number. Each field has a specific data type.
 A database is an organized collection of related data stored electronically in a systematic way. It allows easy storage, retrieval, and management of information. Example: A school database storing student records.

5. Show the output in dry run table. 
CLS
P=1: Q=1
CALL DISP(P,Q)
END

SUB DISP(M,N)
 WHILE (N<=5)
   PRINT M
   M = M*10 + N
   N = N + 1

 WEND
END SUB

StepMNOutput Printed
1111
211211
31123112
4112341123
511234511234
61123456Loop Ends


6. After debugging 

REM To display some records from data file "info.dat"
CLS
OPEN "MARKS.DAT" FOR INPUT AS #1
PRINT "Roll Number", "Name", "English", "Nepali", "Maths"
DO WHILE NOT EOF(1)
 INPUT #1, Rn, Ns, E, Ne, M
 PRINT Rn, Ns, E, Ne, M
LOOP
CLOSE #1
END

Q.7 Study Program

DECLARE SUB TEST(A, B, C) LET X=4 LET Y=7 LET Z=12 CALL TEST(X, Y, Z) PRINT X, Y, Z END SUB TEST(A, B, C) A = A + 3 B = B + 2 SUM = A + B + C PRINT SUM END SUB

a. List arguments and parameters:
 Arguments = X, Y, Z
 Parameters = A, B, C

b. List local variables:
 Local variables in main = X, Y, Z
Local variables in sub = A, B, C, SUM


Q.9 (a) Program for surface area & volume of cylinder in QBASIC

DECLARE FUNCTION SURFACE(R, H) DECLARE SUB VOLUME(R, H) INPUT "Enter radius: ", R INPUT "Enter height: ", H PRINT "Surface Area = "; SURFACE(R, H) CALL VOLUME(R, H) END FUNCTION SURFACE(R, H) SURFACE = 2 * 3.14 * R * (R + H) END FUNCTION SUB VOLUME(R, H) V = 3.14 * R * R * H PRINT "Volume = "; V END SUB

Q.9 (b) QBASIC program (Employee.txt)

OPEN "Employee.txt" FOR INPUT AS #1 DO WHILE NOT EOF(1) INPUT #1, ID, Name$, Gender$, Dept$, Salary IF Dept$="IT" AND Salary>50000 THEN PRINT ID, Name$, Gender$, Dept$, Salary END IF LOOP CLOSE #1 END

Q.10 C program (smallest number among three)

#include <stdio.h> int main() { int a, b, c; printf("Enter three numbers: "); scanf("%d %d %d", &a, &b, &c); if (a<b && a<c) printf("Smallest = %d", a); else if (b<a && b<c) printf("Smallest = %d", b); else printf("Smallest = %d", c); return 0; }


COPYRIGHT TO MILAN BARAL 

Saturday, 29 March 2025

SEE -2081 COMPUTER SCIENCE SOLVED

         SEE SOLVED SET -2081 COMPUTER


Answer the following questions in one sentence                                      6 x 1=6

1. What is telecommunication?

Telecommunication is the transmission of information over a distance using electronic means, such as telephone, radio, television, and the internet.

2. Give any two examples of simplex mode.

Television Broadcasting

Radio Transmission

3. Write two methods of creating a table in MS-Access.

Using Design View .

Using Datasheet View

4. What is the maximum character limit for a field name in MS-Access?

The maximum character limit for a field name in MS-Access is 64 characters.

5. Write the syntax of the KILL statement in QBASIC

KILL "filename.ext"

6. Write two keywords used in C language.

1.     int

2.     return

2.Write appropriate technical term for the following                         2

1. What do we call websites that search documents for keywords?

Search Engines.

2. What is the recording of interaction with the digital world?

Digital Footprint.

3. Write the full forms of the following question              ( 2)

UPS – Uninterruptible Power Supply

VR – Virtual Reality

 

                   Group B

     4. Answer the following questions:                                    (9 x2=18)

1. Define cyber law and list one do’s and don’ts of cyber ethics.

Cyber law refers to the laws that govern activities on the internet, including cybersecurity, privacy, and digital transactions.

Do’s of Cyber Ethics:

Use strong passwords and protect personal information.

Don’ts of Cyber Ethics:

 Do not engage in hacking or cyberbullying.

 

2. Define antivirus software and give two examples.

Antivirus software is a program designed to detect, prevent, and remove malicious software (malware) such as viruses, spyware, ransomware, and trojans. It helps protect computers and networks from security threats.

Examples:

Avast Antivirus

Norton Antivirus

 

3. Why is e-commerce more popular than traditional commerce? (Two reasons)

E –commerce is more popular than traditional commerce Customers can shop online anytime and from anywhere, avoiding physical store visits, making the process time-efficient.

 Businesses can reach a global audience without requiring physical stores, increasing their customer base and revenue potential

 

.4. What is e-governance? Provide two examples of e-governance services in Nepal.

E-governance refers to the use of information and communication technology (ICT) by the government to provide services, information, and facilitate communication with citizens, businesses, and other government agencies. It enhances transparency and efficiency in government operations.

Examples in Nepal:

Online PAN registration – Issued through the Inland Revenue Department (ird.gov.np) for tax purposes.

Driving License Application – Managed by the Department of Transport Management (doit.gov.np) to streamline license issuance.

5. What is a database? Name two data types used in MS-Access.

A database is a structured collection of related data stored electronically to facilitate easy access, management, and retrieval. It helps in organizing large amounts of data systematically.

Data Types in MS-Access:

Text – Stores short alphanumeric data (e.g., names, addresses), allowing up to 255 characters.

Number – Stores numerical values (e.g., age, price, quantity) and supports different number formats.

 

6. What is the difference between Field and Record? (Two differences)

Field

Record

A field is a single column of data representing a specific attribute (e.g., Name, Age).

A record is a complete row of data, containing multiple fields (e.g., John, 25).

It represents a specific type of information within a table.

It represents a single entry in a table, consisting of multiple fields.

7. Define a report. Why is it necessary in DBMS?

A report is a formatted and structured output of database queries, often used for analysis, presentation, and decision-making. It is necessary in DBMS as it summarizes large data for better interpretation and decision-making and it facilitates easy sharing of organized data with stakeholders, improving communication and transparency.

 

 

8. What is a query? Mention different types of action queries.

A query is a request made to a database to retrieve, update, or manipulate specific data based on given conditions. Queries help users filter and manage large datasets efficiently.

Types of Action Queries:

Append Query

Delete Query

Update Query

Make Table Query

 

 

5. Write down the output of the given program show them in dry run table.          2

DECLARE SUB Display (TS)

TS="COMPUTER"

CALL Display (TS)

END

 

SUB Display (TS)

FOR C=1 TO LEN(TS) STEP 2

    DS=MID$(TS,C,1)

    PRINT DS;

NEXT C

END SUB

 

Dry Run Table:

C

D$ =(MID$(TS,C,1))

Output

1

C

C

3

M

M

5

U

U

7

E

E

Final Output:

C M U E

6. Rewrite the given program after correcting the bugs                                          2

REM to add record in an existing file.

OPEN "student.dat" FOR OUT AS #2 

TOP:

INPUT "Enter Name, Class and Roll No.: "; SName$, C, RN 

INPUT#2, SName$, C, RN 

INPUT "More records"; Y$ 

IF UCASE$(Y$) = "Y" THEN GOTO POP 

CLOSE #2 

STOP 

After debugging

 

REM To add record in an existing file

OPEN "student.dat" FOR APPEND AS #2

TOP:

INPUT "Enter Name, Class and Roll No:"; Name$, C, RN

WRITE #2, Name$, C, RN

INPUT "More records"; Y$

IF UCASE$(Y$) = "Y" THEN GOTO TOP

CLOSE #2

END

     Group C

Convert/Calculate as per the instruction:                              4 x 1 = 4

(i)(1503)8=(?)16

(ii) (101000101)2=(?)8

iii) (1010+1101)2−(110)2

iv) (100111)2 ÷(110)2



 

 

9.A Write a program in QBASIC that asks length, breadth, and height of a room and calculate its perimeter and volume.Create a Function procedure to calculate perimeter and Sub procedure to calculate volume [Hint: volume= LXBXH and Perimeter= 2(L+B)                                                4 x 2= 8

DECLARE FUNCTION Perimeter(L, B)

DECLARE SUB Volume(L, B, H)

CLS

INPUT "Enter Length: ", L

INPUT "Enter Breadth: ", B

INPUT "Enter Height: ", H

PRINT "Perimeter = "; Perimeter(L, B)

CALL Volume(L, B, H)

END

FUNCTION Perimeter(L, B)

    Perimeter = 2 * (L + B)

END FUNCTION

 

SUB Volume(L, B, H)

    V = L * B * H

    PRINT "Volume = "; V

    END SUB

B. Write a program to read data from the sequential data file "std.dat" which contains:

Student's name, Roll No.Marks of English, Nepali, Maths, and Computer and display the result with all the information of those students whose marks in Computer are more than 40.                     4

 

OPEN "std.dat" FOR INPUT AS #1

DO WHILE NOT EOF(1)

    INPUT #1, Name$, Roll, Eng, Nep, Maths, Comp

    IF Comp > 40 THEN

        PRINT Name$, Roll, Eng, Nep, Maths, Comp

    END IF

LOOP

CLOSE #1

10 Find the greatest number among any two different input numbers.       4

#include <stdio.h>

int main() {

    int a, b;

    printf("Enter two numbers: ");

    scanf("%d %d", &a, &b);

    if(a > b)

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

else

 

        printf("%d is greater\n", b);

    return 0;

}

OR

 

(ii) Display the series: 5, 10, 15, 20, ...... up to the 15th term.

 

#include <stdio.h>

 

int main() {

    int i;

 

    for (i = 1; i <= 15; i++) {

        printf("%d ", 5 * i);

    }

 

    return 0;

}

 

 

http://www.milanbaral123.blogspot.com


 





SEE IMP QUESTIONS C LANGUAGE

  Write a C program to calculate simple interest . The program should accept the principal amount , rate of interest , and time period as ...