VTU Exam papers Computer Concepts and C Programming
1st & 2nd Sem B.E. Degree Examination, Dec.08/Jan.09
Note : Answer any FIVE full questions selecting at least one from each part.
- Write down the block diagram of a digital computer and explain each briefly. (10 Marks)
- Distinguish between floppy disk and hard disk used in computers. (05 Marks)
- Explain how data is stored in disks using magnetic storage. (05 Marks)
- Distinguish between System Software and Application Software with suitable examples.
- What are advantages and disadvantages of assembly languages and high level languages? Briefly explain. (04 Marks)
- What is a Computer Network? Distinguish between LAN and WAN. (04 Marks)
- What is an algorithm? Explain with the help of a flow chart how the largest number may be displayed amongst the numbers that are entered into the computer. (10 Marks)
- Write down the four steps involved in executing a program to be written in *C’, with an example. (05 Marks)
- Mention any five types of ‘C’ tokens. (05 Marks)
- State the differences between the declaration of a variable and the definition of a symbolic name, with suitable example. (10 Marks)
- Following is a *C’ program, main ()
int a; float b; char c;
printf (“Enter values of a, b and c : \ n”); if (scanf (“% d % f % c” &a, &b, &c) – = 3) printf (“a = % d b – % f c = % c \ n”, a, b, c); else
prinlf(“Error in input \ n”);
What are the outputs for the following data entered? (10 Marks)
23 78 9 8 A 5.25 15.75 23 B
CC PI 3/23
- List out and write the meanings of 6 relational operators and 3 logical operators in ‘C’ languages. Write an example for the operators = – and !.
- Determine the value of each of the following logical expressions if a = 5, b – 10 and c — -6. a > b &&a < c
a < b && a > c a = = c!!b>a
b > 15 && c < o !! a > o. (08 Marks)
- Determine whether the following are true or false
i) When if statements are nested, the else gets associated with the nearest if without an else.
ii) One if can have more than one else clause.
iii) A switch statement can always be replaced by a series of if..else statements.
iv) A switch expression can be of any type.
v) A program stops its execution when a break statement is encountered. (10 Marks)
- Write a ‘C’ program using a do., while loop to calculate and display the first m Fibonacci numbers which has the sequence 1, 1, 2, 3, 5, 8, 13,………….. (10 Marks)
- A and b are one-dimensional arrays containing p and q number of integers sorted in the ascending order. Write a ‘C* program to merge the two arrays A and B and create an array C of size (p + q) containing all elements of A and B such that elements in C are also sorted.
Generate appropriate messages for invalid input and output. (12 Marks)
- Explain the common features and the diffences between global and static variables, with suitable examples. (08 Marks)
8 a. .Write a program in *C’ to replace a word in a text by another word. (12 Marks)
- If m and n are declared as integers and pi and p2 as pointer to integers, then state the errors, if any, in the following statements, pi = &m; p2 = n;
*pl = &n;
rn — p 1 — p2. (08 Marks)