BCA METHODOLOGY OF PROGRAMMING AND C LANGUAGE -First Semester-Internal Examination-September 2023

Section A

Answer any 5 questions. Each question carries 2 marks.

(Write in not less than a paragraph)

 

1.    Write an algorithm to check whether a number is Palindrome or not.

Step 1. Start

Step 2. Read the number from the user and store in two variables n,p

Step 3. Find the reverse of a number

Step 4. If p = rev:

                             7.1: Print “Given number is palindrome”

Step 5. Else:

                             8.1: Print “Given number is not palindrome”

Step 6. Stop

 

2.    Explain the structure of a C program.

C program is divided into six sections: Documentation, Link, Definition, Global Declaration, Main () Function, Subprograms. While the main section is compulsory, the rest are optional in the structure of the C program.

 

 

3.    Explain the various C data types.



 

4.    Define the term 'type casting'.

 

Typecasting is a method in C language of converting one data type to another.

There are two types of typecasting.

1.Implicit Type casting This conversion is done by the compiler. When more than one data type of variables is used in an expression, the compiler converts data types to avoid loss of data.

2.Explicit Type casting This conversion is done by user. This is also known as typecasting. Data type is converted into another data type forcefully by the user.

 

5.  What is dynamic initialization?

Dynamic Initialization: Here, the variable is assigned a value at the run time. The value of this variable can be altered every time the program is being run.

6.Compare while and do while loop.



 

                                                                        (10 x 2 = 20 Marks)

Section B

Answer any 3 questions. Each question carries 5 marks

 

13. Explain Interpreter and Compiler.

Interpreter translates just one statement of the program at a time into machine code. Compiler scans the entire program and translates the whole of it into machine code at once. An interpreter takes very less time to analyze the source code. However, the overall time to execute the process is much slower.

14.  Explain the various decision statements in C?

  • nested if statements
  • if-else statements
  • if statements

 

15. Explain the various operators in C.

An operator is a symbol which operates on a variable or value. There are types of operators like arithmetic, logical, conditional, relational, bitwise, assignment operators etc. Some special types of operators are also present in C like sizeof(), Pointer operator, Reference operator etc.

 

16. Distinguish break and go to statements with the help of examples.

Break Statement:
This is used for two important purposes:

·         The break statement is used to terminate the switch case statement.

·         It is used to terminate the looping statements like forwhile and do-while.

 

goto statement:

·         The goto statement is used to jump from one line to another in the program.

 

 

                                                                                            (6*5=30)

 

Section C

Answer any 1 question. Each question carries 15 marks.

 

22.  Explain the various types of programming languages with its advantages and disadvantages.

ASSEMBLY LANGUAGE

MACHINE LANGUAGE

HIGH LEVEL LANGUAGE with advantages and disadvantages

23. Explain the different C tokens.

Types of Tokens in C language

Tokens in C language can be classified as:

(15*2=30) 

Comments

Popular posts from this blog

UG, S1 BCA, First internal examination, Introduction to Problem Solving and Web Designing, September 2024