MCA I (First) Semester Examination 2014-15

Course Code:MCA101 Paper ID: 0871201

C-Programming

Time: 3 Hours Max. Marks: 70 Max Marks: 75

Note: Attempt six questions in all. Q. No. 1 is compulsory.

1. Answer any five of the following (limit your answer to 50 words). (4x5=20)

a) What are the features of Fourth Generation Computers?

b) Explain the difference between while and do- while statements with an example.

c) Explain bitwise & logical operators with example.

d) Write the syntax of switch statement with example.

e) Write a program in C to swap two integer values without using a temporary variable.

f) Discuss separate compilation and linkage.

g) What is the relation between arrays and pointers in C?

h) What are the names of * and & operators in C language? How they are used?

2. a) Explain various types of Display devices used in a computer system? (5)

b) What do you understand by programming? What are the features of good programming? (5)

3. a) Write a program in C to print the Fibonacci Numbers that are less than 1000. Also print how many such numbers are printed. (5)

b) Write a C program to generate the following pattern (get the number of rows in the pattern from the user): (5)

1

1 2 3

1 2 3 4 5

1 2 3

1

4. a) Write a program in C to check if a given string is palindrome or not. (5)

b) Write a program in C which inputs character text from user and prints number of Lines, words and characters in it. (5)

5. a) Explain various types of Storage Classes that can be declared in C with suitable example codes. (5)

b) Declare a structure, which will contain the following data for 5 employees:

Employee Number (Integer)

Employee Name (Character String)

Designation (Character String)

Monthly Salary (Integer)

The program should accept the data of all the Employees from the keyboard and print the details of those Employees whose monthly salary is in five digits. (5)

6. a) Write an algorithm to find the largest among 10 integer numbers. (5)

b) Write a function, which accepts Roll number, Physics, Chemistry and Maths marks in the main program.

Another function, say result calculates the percentage. On the basis of percentage, it decides grade of the student. It returns grade to the main function, where it gets printed. Grade is decided as follows: (5)

i) Grade F if percentage < 50

ii) Grade B if percentage >=50 but less than 75

iii) Grade A if percentage>=75

7. a) Write C program to sort 10 integers using Bubble sort method. (5)

b) What are bitwise operators in C? What is their basic characteristic? Explain each of them with the help of suitable examples. (5)

8. a) Write a program in C which copies each character in one file to a backup file. (5)

b) Write a program to convert a Roman number to its decimal equivalent. (5)