NEB year 2068 computer science questions and solutions

NEB year 2068 computer science questions 

(old syllabus)


Attempt any two questions..(2x20=40)


      a)what is an operator?Explain different types of oeprator used in programming with example.[1+4]



operator:- It is a symbol or a character used in programming. It is used to carry out some operation.
for example: +,-,= etc
Types of operator:-
It is of following types.
1)Arithmetic operator: It is used to do arithmetic calculations/operation.
 It has following types.

 +         -----------> used for addition.example is a+b. It means we are performing addition with the help of operand a and b
-           ------------>It is used for subtraction.Example is a-b.  It means we are performing subtraction with the help of operand a and b
* -------------------->used for multiplication.example is a*b. It means we are performing multiplication with the help of operand a and b
/---------------->used for division.example is a/b. It means we are performing division with the help of operand a and b
%---------------->used for remainder division.example is a%b. It means we are performing division with the help of operand a and b.It gives us remainder after division.

2)relational operator: 
This operator is used to perform comparisons between variables.It supports us to take decision logically. example,x>y ,x>=y etc
Relational operator has following types.

>------> It is used to show greater than. like x>y
>=----->It is used to show greater than or equals to.like x>=y
<-------->It is used to show a variable is smaller than another.like x<y
<=-------> It is used to show smaller than or equals to with another variable.Like x<=y
!=----------> I simply says , two variables are not equal in value.like x!=y
==---------->It says two variables have same value.It is used to test values of two variables.

3)Logical operator:-
                                   This operator is quite helpful when we want to combine multiple  conditions and take decision.It returns values in the form of 0 o 1.It works logically.
Its types are:

3.a)and (&&)-----------> It is called 'and'operator.It is used to combine multiple conditions.It gives us true output if all of them are true otherwise we get false output.
 example:if(a>b && a>c)
                            display a     
 we can see here that to be greatest,value of 'a' must be greater than b and c. So we use here '&&'
  3.b)or(||):- It is called 'or'operator.It is used to combine multiple conditions.It gives us true output if anyone of them is true or all are true otherwise we get false output.
 example:if(a==90 || b==90 || c==90)
                            display right angle triangle  
 we can see here that to be right angled triangle,either 'a'or 'b'or 'c' a must be 90 . So we use here '||'.

3.c) !(not )operator:-
                                It is used to reverse the result.
int a=5;
printf("it is\n");
printf("it is not\n");
here ,the value is 5 but we get output "it is not".It is called reversing the output.

4) Assignment operator:
                                an operator ,symbolized by '=' character,is called assignment operator.It assigns value to variable.
int a=6;
It means, we are assignming value 6 to variable a.

5)Unary operator:- this operator  works on one operand only.It has two types.
                               I) increment operator:- It increases the value of given variable by one.For example: ++y or y++
                                             It can be classified into pre-increment and post increment.
                                                 pre-increment:- It is written as ++x.It means first increase the value and then use that.
                                                 post-increment: It is written as x++.It means, first use that and then increase its value by one.

                               II)decrement operator:- It decreases the value of given variable by one.For example: --y or y--
                                             It can be classified into pre-decrement and post decrement.
                                                 pre-decrement:- It is written as --x.It means first decrease the value and then use that.
                                                 post-decrement: It is written as x--.It means, first use that and then decrease its value by one.

Besides these all, we have some other operators .like  bitwise,

        b)Define nested loop.Write a program to calculate and display the multiplication table using nested loop.[2+3].


    Nested loop:

We can write an entire loop structure inside another loop structure. So a loop inside another loop is called a nested loop.


for(initialization; condition ; increment/decrement)
    for(initialization; condition ; increment/decrement)
int main()
    int i,j,k=3;
    return 0;
Second part:-
//program to display multiplication table of  nth term using nested loop.
int main()
    int i,j,n;
    printf("enter a number\n");
    return 0;

     c)Write a program to find out factorial of a number.[5]


        //program to get factorial value of a positive number

void main()
   int number,fact=1,i;
   printf("enter any positive number\n");

printf("the number is not +ve\n");
 printf("the factorial value for entered number=%d is =%d\n",number,fact);

    d)What do you mean by local,global and static variables.Explain with examples.[5]


    Local variables:-

                            Those variables which are declared inside the function are called local variables.They can not be accessed from other function or outsiders. It means scope is limited to that function where  it is declared. For local variables, either we use keyword 'auto' or simply variables with data types.


        void sum()


                int a,b;

                int sum;       


            Here, a,b and sum are local variables.

    Global variables:-

                            Those variables which are declared outside the function are called global variables.They can  be accessed from other function or outsiders. It means scope is not limited to that function. For global variables, either we use keyword 'extern' or simply variables with data types.


        int a=7,b=9;    

        int sum;       

        void sum()




            Here, a,b and sum are global variables. Once we declare them , it does not need to be declared inside the function. It works.

static variables:-

                           Compiler can know the value of variables till it is called.After calling compiler loses its content i.e. function forgets the value. i.e. our function can not retain its value after calling. To overcome this problem, we have to use keyword 'static' with variables. It retains the variables values even after calling. 


       #include <stdio.h>

        void sum();

         int main()




            return 0;


void sum()


    int a=7,b=9;    

    printf("sum is=%d\n",a+b);



          If we run this program, we will get 16 two times. It means there will be no change in output of statement 'b++'. For this we have to use static in front of int a=7,b=9 i.e. 

static int a=7,b=9. If we use it then computer remembers old values and we will get different values.

Now we will get first 

16 then



      a)What is an array?Write down similarilities and differences of array with pointer.[5]



    Definition: A composite variable capable of holding multiple data of same data type under a single variable name is called array.

->stores multiple values
->helps to solve complex porblem
->can be used as array as pointer
->pixel based graphics programming made easier etc

Declaration of Array:

datatype array_name [size];

Example: - int marks [10]; int x[4]={1,2,3,4};

Array size is fixed at the time of array declaration.

Generally, we use for loop () to assign data or item in memory and also use this loop to extract data from memory location.

Types of Array:

There are 2 types of array.

a) One Dimensional Array (1-D): IT is an array where we use one subscript value.It stores value in row in contigous cells.
data type arra[value/size];
For example:
int a[10];
This array stores ten value starting from location zero na dends at 9.

b) Two Dimensional Array (2-D):an array where we may use two or more than two subscript values.
In this we use matrix concept.
data type arra[row size][column size];
For example:
int a[2][2];
It uses two rows and two columns.
Values are stored as:


Column zero

Column one

Row 0 à



Row 1à



This array stores total four  values starting from location zero and ends at 1.

second part:-
Similarlities between array  and pointer:-
1.Both are  simply a variable: In our program we use them as variable.
            e.g. for array, we use int a[10]-->It stores 10 values
                    for pointer, we use int *k-->It stores address of a variable.
2.For Addressing:-In our program we can use both for addressing mechanism.
            e.g.For array, we may use array as pointer directly without declaraing as pointer.
                int a[10];----->we can use (a+0),(a+1)...... to point an address. We may use (a+i). Here value of i changes from 0 to 9. 
                For pointer, if we write int *pt, then writing pt=a  or pt=&a[0] for an array a[10]  are same.They mean the pointer is going to store address of first location.

2.Differences between array and pointer:-

            1.     The code

	int a[10], b[10];
	a = b;				/* WRONG */
            is illegal. As we've seen, though, you can assign two pointer variables:
	int *ip1, *ip2;
	ip1 = &a[0];
	ip2 = ip1;
            ->Array can be initialized at definition. e.g. int a[3]={1,2,3};

-> Pointer can not be initialized at definition

3.Array can not re-allocate assigned memory.

Pointer can re-assign the allocated memory.

4.In array memory allocation is in seqence.

In pointer memory allocation is Random.

      b)Write a program to read salaries of 300 employees and count the number of employees getting salary in range 10000 and 15000.[10]


    /* to count ttoal number of employees getting salary between 10,000 to 15,000.


#include <stdio.h>

int main()


    float salary[300];

    int i,count=0;

    printf("enter salary of 300 employees\n");




        if(salary[i]>=10000 && salary[i]<=15000)





    printf("total number of employees getting salary in 10000 and 15000 is=%d",count);

    return 0;



    a)Write a program to sort an array of n elements in descending order.[10]


    /* program to sort n elements in descending order and print them.


#include <stdio.h>

int main()


int numbers[100];

int n,i,j,k;

printf("enter the size of n\n");


printf("Enter numbers\n");

















printf("numbers in descending order are=:\n");





return 0;


   b)Write a program to enter name,roll number and marks of 10 students and store them in a file.Read and display the same from the file.[10].



int main()


 FILE *p;

char name[100];

int roll;

int eng,phy,maths,chem,csc;


printf("enter name,roll marks in eng,phy,maths,chem and csc\n");

printf("To exit ,press ctrl+z\n");







printf("data are\n");



 printf("name=%s,roll=%d, english=%d,physics=%d,maths=%d,chemistry=%d ,csc=%d \n",name,roll,eng,phy,maths,chem,csc);



return 0;



Attempt any five questioons.

q4)What do you understand by the term data integrity?Why is it important in designing database?[2+5]


Data integrity: 

                   Integrity is consistency of actions, values, methods, measures, principles, expectations and outcome. 

Data integrity is a term used in computer science and telecommunications that can mean ensuring data is "whole" or complete, the condition in which data are identically maintained during any operation (such as transfer, storage or retrieval), the preservation of data for their intended use, or, relative to specified operations, the a priori expectation of data quality. 


Entity integrity concerns the concept of a primary key. Entity integrity is an integrity rule which states that every table must have a primary key and that the column or columns chosen to be the primary key should be unique and not null. It means the primary key’s data must not be missing in table/s.


Referential Integrity

Referential integrity ensures that the relationship between the primary key (in a referenced table) and the foreign key (in each of the referencing tables) is always maintained. The maintenance of this relationship means that:

  • A row in a referenced table cannot be deleted, nor can the primary key be changed, if a foreign key refers to the row. For example, you cannot delete a customer that has placed one or more orders.

  • A row cannot be added to a referencing table if the foreign key does not match the primary key of an existing row in the referenced table. For example, you cannot create an order for a customer that does not exist.

Domain Integrity

Domain (or column) integrity specifies the set of data values that are valid for a column and determines whether null values are allowed. Domain integrity is enforced by validity checking and by restricting the data type, format, or range of possible values allowed in a column.


This integrity concept is used to handle/manage:

1.reduce redundancy

2.Maintain consistency

3.To handle simple as well as complex query

4.to link tables

5.to avoid wrong or invalid entry of data.


q5)What is feasibility study?Explain different level of feasibility study?[2+5]


Feasibility study:-

 It is the measure and the study of how beneficial the development of the system would be to the organization. This is known as feasibility study. The aim of the feasibility study is to understand the problem and to determine whether it is worth proceeding.
It has following types.

1.Technical feasibility: - This is concerned with availability of hardware and software required for the development of system.The issues with can be like:
1.1) Is the proposed technology proven and practical?
1.2)the next question is: does the firm possess the necessary technology it needs. Here we have to ensure that the required technology is practical and available. Now, does it have required hardware and software?
1.3)The Last issue is related to availability of technical expertise. In this case, software and hardware are available but it may be difficult to find skilled manpower.
2.Operational feasibility:- It is all about problems that may arise during operations. There are two aspects related with this issue:
2.1) what is the probability that the solution developed may not be put to use or may not work?
                                   2.1) what is the inclination of management and end users towards solutions?
Besides these all some more issues;
                                                           a) Information: saying to provide adequate, timely, accurate and useful information to all categories of users.
                                                       b) Response time, it says about response about output in very fast time to users.
                                            c) Accuracy: A software system must operate accurately. It means, it should provide value to its users. It says degree of software performance.
           d) Services:- The system should be able to provide reliable services.
             e)Security:- there should be adequate security to information and data from frauds.
f) Efficiency: The system needs to be able to provide desirable services to users.
3) Economic feasibility: - It is the measure of cost effectiveness of the project. The economic feasibility is nothing but judging whether the possible benefit of solving the problem is worthwhile or not. Under "cost benefit analysis", there are mainly two types of costs namely, cost of human resources and cost of training.
                                                             The first one says about salaries of system analysts, software engineers, programmers, data entry operators etc. whereas 2nd one says about training to be given to new staffs about how to operate a newly arrived system.

4) Legal feasibility: - It is the study about issues arising out the need to the development of the system. The possible consideration might include copyright law, labor law, antitrust legislation, foreign trade etc.
Apart from these all we have some more types:
behaviour feasibility, schedule feasibility study etc.

q6)Why polymorphism and inheritance are important concepts of OOP?Explain.[7]


polymorphism :-
Its an important OOPs concept , Polymorphism means taking more than one forms .Polymorphism gives us the ultimate flexibility in extensibility. The ability to define more than one function with the same name is called Polymorphism.Polymorphism allows the programmer to treat derived class members just like their parent class’s members. More precisely, Polymorphism in object-oriented programming is the ability of objects belonging to different data types to respond to calls of methods of the same name .If a Dog is commanded to speak(), this may elicit a bark(). However, if a Pig is commanded to speak(), this may elicit an oink(). Each subclass overrides the speak() method inherited from the parent class Animal.
example is:
Simple example of Polymorphism, look at an Account (it may be checking or saving assuming each attract different dividends) you walk in a bank and ask a teller what is my balance? or dividends? you don't need to specify what kind of an account you're having he will internally figure out looking at his books and provide you the details.

Inheritance is mainly used for code reusability.In the real world there are many objects that can be specialized. In OOP, a parent class can inherit its behavior and state to children classes. Inheritance means using the Predefined Code. This is very main feature of OOP, with the advantage of Inheritance we can use any code that is previously created. This concept was developed to manage generalization and specialization in OOP.  Lets say we have a class called Car and Racing Car . Then the attributes like engine no. , color of the Class car can be inherited by the class Racing Car . The class Car will be Parent class , and the class Racing Car will be the derived class or child class
The following OO terms are commonly used names given to parent and child classes in OOP:
Superclass: Parent class.
Subclass: Child class.
Base class: Parent class.
Derived class: Child class
It can have many types.
single inheritance:-one derived class inherits property from one base class
multiple              “  :- one derived class inherits property from many base classes.
multi level          “ :-in this many derived classes are inherited from many base classes
hierarchical       “ :-under this many derived classes can be inherited from single base class
hybrid                 “:-it’s a combination of hierarchical and multilevel.

q7)Define program logic.Explain different program logic tools.[2+5]


Program Logic:

These are the tools we use in system design.They are quite helpful to understand different parts of system as well as progam.Mostly they use diagrammatic concept to represent our program.It makes clear about data,flows,conditions etc.

.It describes desired features and operations in detail, including screen layouts, business rules, process diagrams, pseudo code and other documentation. We can use two designing methods namely logical (what is required for IS) and physical (how to achieve requirements). At first we design logical and then it is converted into physical design. A prototype should be developed during the logical design phase if possible. The detailed design phase modifies the logical design and produces a final detailed design, which includes technology choices, specifies a system architecture, meets all system goals for performance, and still has all of the application functionality and behavior specified in the logical design. 

           This design can carry following activities:

  • Defining precisely the required system output

  • Determining the data requirement for producing the output

  • Determining the medium and format of files and databases

  • Devising processing methods and use of software to produce output

  • Determine the methods of data capture and data input

There are many designing tools e.g.
Algorithm,Flowchart,Decision tree,decision table etc.
Let's understand about two.


An algorithm is an effective method or a tool for solving a problem using a finite sequence of well organized instructions. Algorithms are used for calculation, data processing, and many other fields.

                                   Each algorithm is a list of well-defined instructions for completing a task. Starting from an initial state, the instructions describe a computation that proceeds through a well-defined series of successive states, eventually terminating in a final ending state. For example,


-->read a no. x

-->read a no. y

→ let sum=x+y

-->display sum


Decision tree:- Decision tree is a set of rules for what to do in certain condition and if particular condition  

satisfies, do that otherwise go to this step. They can be used to enforce strict compliance with local procedures, and avoid improper behaviors, especially in complex procedures or life-and-death situations.

E.g. If the photocopier breaks down, call Raj. If Raj is not available, call Aasha. If Aasha is away, ring Sary.

They are valuable when setting out how the system should behave, and what conditions it will need to be able to cope with. A decision tree showing decisions and actions required of a software system

In above diagram we can see how an applicant is selected or hired under different condition.Sometimes in critical situation it can be used for decision taking. 

q8)What is ysystem ananysis?What are the major objectives of system ananlysis?Explain.[2+5]


system ananysis:-

Once the problems identified, it is time to analyze the type of software that could answer the problems encountered. System analysis (may be by system analyst) will take a look at possible software. The goal of a system analysis is to know the properties and functions of software that would answer the concerns solicited from intended users.

                                                     System Analysis would lead in determining the requirements needed in software. These requirements in software should be implemented otherwise the software may not answer the concerns or may  lack in its usage. This stage will somehow determine how the software should function.

                                                                                   It is the study of complete business system or parts of business system and application of information gained from that study to design,documentation and implementation of new or improved system. This field is closely related to operations research. An analyst work with users to determine the expectation of users from the proposed system.

Major objective of analysis:

                                                              The development of a computer-based information system often comprises the use of a systems analyst. When a computer-based information system is developed, systems analysis would constitute the following steps/points.

  • The development of a feasibility study, involving determining whether a project is economically, socially,, technologically, organisationally,legally, schedule feasible.

  • Conducting fact-finding measures, designed to ascertain the requirements of the system's end-users typically interviewing, questionnaires, or visual observations of work on the existing system.

  • It gives us answer of go /or do not go for development.

q9)Explain benefits of centralized database.



A centralized database (sometimes abbreviated CDB) is a database that is located, stored, and maintained in a single location. ... Users access a centralized database through a computer network which is able to give them access to the central CPU, which in turn maintains to the database itself.

This centralized database is mainly used by institutions or organizations. Since all data is stored at a single location only thus it is easier to access and co-ordinate data. The centralized database has very minimal data redundancy since all data is stored at a single place.


->Job is centralized.

->It Can not process if main server fails.

->Its Security is given to one machine.

->No need to have network for communication.Not so expensive to set up.

->Data speed is comparatively fast.

q10)What are the types of LAN topology?epxlain with diagram.


As we know there are many types LAN topologies. 
1.Bus topology
2.Star topology
3.Mesh topology
4.Ring topology
5.Star-ring topology
6.Tree topology
Here we are going to understand about two.

star topology:

A star topology is designed with each node (file server, workstations, and peripherals) connected directly to a central network hub, switch, or concentrator (See fig. 2).
Data on a star network passes through the hub, switch, or concentrator before continuing to its destination. The hub, switch, or concentrator manages and controls all functions of the network.
 It also acts as a repeater for the data flow. This configuration is common with twisted pair cable; however, it can also be used with coaxial cable or fiber optic cable.

                Fig. 2. Star topology

Advantages of a Star Topology

  • Easy to install and wire.

  • No disruptions to the network when connecting or removing devices.

  • Easy to detect faults and to remove parts.

Disadvantages of a Star Topology

  • Requires more cable length than a linear topology.

  • If the hub, switch, or concentrator fails, nodes attached are disabled.

Ring topology:
A ring network is a network topology in which each node connects to exactly two other nodes, forming a single continuous pathway for signals through each node – a ring. Data travels from node to node, with each node along the way handling every packet.

Advantages of Ring topology:

  • Reduced chances of data collision as each node release a data packet after receiving the token.
  • Token passing makes ring topology perform better than bus topology under heavy traffic.
  • No need of server to control connectivity among the nodes.10. Describe the wireless network system. List out deices and equipment necessary for Wi-Fi network. 3+2
1.It is difficult to find the problem.
2.To add extra noe or computer, we have to di-assemble entire networks.
3.It is expensive
4.Shutting down of one node leads entire networking to be down

q11)What do understand by AI?How it affects the modern society?[2+5]



Artificial intelligence is where machines can learn and make decisions similarly to humans. There are many types of artificial intelligence including machine learning, where instead of being programmed what to think, machines can observe, analyse and learn from data and mistakes just like our human brains can. This technology is influencing consumer products and has led to significant breakthroughs in healthcare and physics as well as altered industries as diverse as manufacturing, finance and retail. In part due to the tremendous amount of data we generate every day and the computing power available, artificial intelligence has exploded in recent years. We might still be years away from generalised AI—when a machine can do anything a human brain can do—, but AI in its current form is still an essential part of our world.

Effects in modern society:-

I think without AI our society can not move.Everywhere we can find use of AI to make our life better and manageable. We have found use of AI in different fields may be business, may be transport, may be aircraft,search,pattern recognition etc.So I think perhaps there would be a society which is not affected.

Not only that much we have found use of AI in watch which monitors our heart pulse, our calorie burnt, our temprature etc.Even we can see in online platforms may be stock market or B2B or C2C , when we buy or request for informtsions, it is interpreeted by a chat bt automatically.So in nutshell without AI we can not imagine our life.

q12)Write short notes on:

  a)Data dictinaory


Database users and application developers can benefit from an authoritative data dictionary document that catalogs the organization, contents, and conventions of one or more databases. The term "data dictionary" is used by many, including myself, to denote a separate set of tables that describes the application tables. The Data Dictionary contains such information as column names, types, and sizes, but also descriptive information such as titles, captions, primary keys, foreign keys, and hints to the user interface about how to display the field.

           A super-simple beginning Data Dictionary might look like this:

                               Among other items of information, it records (1) what data is stored, (2) name, description, and characteristics of each data element, (3) types of relationships between data elements, (4) access rights and frequency of access. Also called system dictionary when used in the context of a system design.

                                    A data dictionary document also may include further information describing how data elements are encoded. One of the advantages of well-designed data dictionary documentation is that it helps to establish consistency throughout a complex database, or across a large collection of federated databases

 b)cyber Law:-

This law is commonly known as the law of the internet. It governs the legal issues of computers, Internet, data, software, computer networks and so on. These terms of legal issues are collectively known as cyberspace. In other words, it is a type of law which rules on the Internet to prevent Internet related crime.

Cyber law is a new and quickly developing area of the law that pertains to persons and companies participating in e-commerce development, online business formation, electronic copyright, web image trademarks, software and data licenses, online financial transactions, interactive media, domain name disputes, computer software and hardware, web privacy, software development and cybercrime which includes, credit card fraud, hacking, software piracy, electronic stalking and other computer related offenses.


  1. El Cajon, the only on casino in town
    I 샌즈 카지노 먹튀 am looking 더킹 카지노 for an old 더킹 카지노 회원 가입 friend, or a former employee, in the future. At El Cajon, 카지노 사이트 제작 he is a former employee of 온 카지노 가입 쿠폰

  2. Playtech casino - 100% Welcome Bonus up to €100
    Best Online Casino for Free with up to €100 casino 룰렛 배당 bonus, 벤델핀 With a high level 먹튀 없는 사이트 of customer support, players can request to 서산 휴게텔 give feedback 솔레어카지노 on their

  3. Slots - Casino Games at the PlayAmo Casino - DRMCD
    The 수원 출장샵 Slots Online Game is a fantastic option for your players 김제 출장샵 to play 청주 출장샵 Slots on your 경상북도 출장마사지 phone, 정읍 출장샵 tablet or mobile device.