BCA 1st Semester Introduction to Algorithms very Important Questions and Answers

 1) Definition of computer.  (*2M)

Answer: A computer is an electronic device that is used for information processing it accept a data and stores in its memory processing and gives the result to the user is known as computer.


2) write a Characteristics of computer.  (*2M)

Answer: 1.high processing speed(MIPS)
                2.Accuracy
                3.Reliability
                4.Versatility
                5.Dillgence.

3) Write the Generation of computer.   (2M)
Answer:
First Generation computer: 1946-59 speed10-³sec
Second Generation computer: 57-64 speed10-⁶sec
Third Generation computer: 65-70 speed10-⁹sec
Fourth Generation computer:70-90 speed10-¹²sec
Fiveth Generation computer:1990 [Fast generation computers and speed not mentioned.]

4) Draw the Block diagram of computer.  (*5M,10M)
Answer: 
A block diagram of computer system is combination of three components

★Input unit
★CPU (central processing unit)
★Output unit

1.Input unit: the input unit consists of input devices such as the most keyboard scanner joystick etc their device are used to input information or instructions into the computer system.

2. CPU : CPU aur central processing unit is known as the brain of the computer system control unit and arithmetic & logic unit are jointly called central processing unit.

3. Controll unit : as the name suggest the control unit of CPU controls all the activities and operations of the computer it is also responsible for controlling input output memory and other devices connected to the CPU

4. Arithmetic &logic unit: the data imported through input devices is stored in the primary storage unit example addition, subtraction ,division and multiplication.on the other side ,the logical unit controll the logical operation such as AND,OR,NOT,etc.

5. Memory unit: memory unit is an essential part of the computer system which used to store data and instructions before and after processing there are two types :-
a)main/primary memory
b) secondary memory

a) main memory: the primary memory cannot store a vast amount of data.the data store in the primary memory is temporary.the data will be lost of they are disconnected from the power supply.the primary memory usually stores the input data and immediate calculation result.the primary memory known as the main memory/primary memory.ex: Ram,etc.

b) secondary memory : the use of primary memory is not possible to store data permanently for future access.there for they are some other option to store the data permently for future which is known as secondary memory.Ex:Hardisk,etc.

6.Output unit the output unit consist of device that are used to display the results or output of processing. Widely use output devices are moniter,printer,and projector ,etc.

5) Write the difference between Hardware and Software.  (*5M) 


6) Define the Linker and loader (*2M)
Answer: A linker is an important utility program that takes the object files, produced by the assembler and compiler, and other code to join them into a single executable file known as linker.
The Loader is a program of operaing system which load the executable from the disk into the primary memory execution is known as loader .

7) Define Compiler and Interpreter.(*2M)
Answer : Compiler it takes the entire high level language program as an input&translate it into the machine level language.
Or
A compiler translates the entire source code in a single run  known as Compiler .
Linker is an important utility program that takes the object file produced by an assembler and compiler &other code to join into single executable file is known as linker 
Or
An interpreter translates the entire source code line by line known as Interpreter.

8) Explain Algorithm and explain steps involved in problem solving.  (*2M,5M)
Answer: An Algorithm is defined as step by step procedure to solving problems known as Algorithm.
Steps involved in solving the problem:

* Problem definition 

*Analysis

* Design.

* Coding

* Running the Program.

* Debugging 

*Testing

* Documentation 

9) Define the Flow chart or Explain the symbols of Flow chart.  (*2M,5M)
Answer: It is a digramatical representation of an algorithm in solving the problem.


10) What is c tokens? Mention there types. (*2M,5M)
Answer: c tokens is in a passage of test individual words punctuation marks are called tokens 
There are types of C Tokens :
★ keywords
★Identifiers
★Constant 
★string
★Variable

1. Keywords:- words which are specific to c language ex: goto,while,for,continue, flot etc

2. Identifiers user defined names/ abbreviations 
rules for identifiers:
i) First character most be an alphabet 
ii) must consist of only letters, digits
iii) Only first 31 characters are significant
iv) cannot used a keyword 
v) must not contain white space.

3.constant:- values which don't change in program constants of two types
i)Numeric-*Integer *Floating
ii)Nin Numeric- *character*string

4. String:- string is and sequence of character terminated with a null \0 character.ex: string="A","Good"

5. Variables :-it's a name given to a memory location where there value is not fixed it can change with course of time .
syntax: Data types variable ;
              Data types=Basic data types

11) write a Data types. (2M)
Answer:
(i)primitive Data types :Boolean,char,Integer,Float,Double,void.
(ii)Derived Data types: Array,pointer, refference
(iii)user-defined type: structure,union,Enum.

12)Expand the IBM and ENTAC. (2M) •"International Business Machine". (IBM) and 
•"Electronic numerical Integrator and computer." (ENTAR)

13)Explain if-else statement with syntax ,flowchart and example.and 
Explain  if statement syntax, flowchart and example
Answer: 






14) write a difference between while loop &do-while loop.  (*5M)
Answer: 

15)what is Array and explain types of Array. (*2M,5M)
Answer: In array is set of homogeneous element or a data.ex:int,float,char,double,etc.
Syntax: 
data types Array name(size);
ex:int matrix [10]
     float char [20].

Types of Array:
★one dimentional array
★Two dimentional array
★multi dimentional array

★ one dimentional array: the array  having only one subscript is known as the one dimentional array ex: int matrix [3].

 ★Two dimentional array: The array having two subscript is known as to dimentional array ex: data types array name (row) (column). int matrix [2] [5].

★multi dimentional array:  The array having more than the one subscript is known as multi dimentional  array .ex: syntax - data type Array name.

16) what is Function and write a advantage of function.  (*2M)
Answer: Function is a block of cold that perform particular task known as Function. 
Or 
Functions is set of instructions to carry of a particular task and insted of going Bigg problems the partician has been done which is nothing but a sub program.
Advantages of functions: 
* Reviseability 
*Debugging is easia
*Build library

17) Define the Argument and parameter.(2M)
Answer: 
Argument: program definition This is a clear in two brackets ()under process in argument known as Argument .

Parameter: Function definition programe main variable process in parameter known as parameter.

18) Explain categories of function. (5M)
Answer: 1.Function with no argument &no return value: the called function does'nt received any data from the calling function and is doesn't not return any value to the Calling function.

2.function with argument &no return value: called function receive the data from the calling function but it doesn't return any value to the calling function.

3.function with no argument but with return value: the call function doesn't receive any data from the called function but it returns value to the calling function.

19) Explain local and global variables and what is parameter passing mechanism.  (*5M)
Answer: local and global variables :-

Both calling and called function uses function there own variables the existence of this. Variables restricted to the calling Called function this is known as scope of a Variable 

Classified into two types:

*local variable. 
*global variable.

1. local variable:

Variable who's existence its known only in the or programe or functions are Called local variables

2.Global variables

The variables who's existence its Known in both main programe and function.. are called of global variables.

Parameter passing mechanism :-

The sort of information inter Change between a calling function & called function this process of transmitting the valve's from one function to the other is known as parameter passing.

There are two method :
1.call by vale 
2.call by reference

1.call by value: the value of arguments are past from calling function to the called function.the values are copy into the called function.
2.call by reference: The actual values are not past insent there address are pass to the Calling function.

20) what is string and Explain any 7 string handling functions .   (*2M,5M,10M)
Answer: String is a sequence of character's terminated with a null character '\0'.

String Handding functions:

'C' supports number of string handling function this functions are defined in the header file ex: string.h

String •h.

There are fertain certain String handling.

1. Strcmp() 
2. Strcpy ()
3 Strcat ()
4.Strlen ()
5.Strncmp () 
6.strncpy()
7.StrnCat() 
8.strnlen ()
9. Strupur ()
10.StrChar ()

1.Strcmp () :- This function is use to compare two String Character by Character.
Syntax:
Strcmp ( String 1, String2);
String1=it's a first character
String 2=it's a second character

Ex: strcmp ("ABC","ABC");

2.strcpy(): This function use, to copy one  String to the other

Strcpy (string 1, String 2); 
String1=  1st Character 
 String 2 = 2nd Character 

Ex: Strcpy (" lotus"  "Rose" );

3. strcat (): This function is used to canditinate two strings

Syntax:
 strcat (String 1, string 2 ); 
 String1= It is a first character
String 2 = It is the second character 

Ex: Strcat ("good", "" morning");
Result = Good morning.

4.strlen (): This function is used to return the number of characters in a string.
Syntax: 
Strlen (String 1); 
where String1 = It is a first character

Ex: Strlen ("morning" );

5. Strncmp(): This function is used to. compare first ʼn characters of two strings Syntax 
Strncmp (String1, String 2, n); 

 Ex: Strncmp ("ABC","abc", 2);

6. Strncpy (): This function is used to copy the first n Characters .
Syntax 
Strncpy (string1 , String 2; n);

 Ex: Strncpy (" 123 ", " 678", 1);
 Result- 623.

7.strncat(): The strcat() function is used for concatenating  'n' characters of one string into another.
Syntax: 
Strncat (string1,string1,n);

 Ex: Strncat("Hii","Good morning",1);
Result- Hii Good .

                    😊  Thank you 😊







 Helping Links :

The easily learn c language to click 👇

                                   ****

                


Comments

Unknown said…
Very help full thank you

Popular posts from this blog

Let's Go Home Summary and Important Questions