Fundamentals of Computer Programming - Unit Wise Questions

Unit 1: Problem Solving with Computer
2 Questions

1. Draw the flow chart for finding largest of three numbers and write an algorithm and explain it.

6 marks | Asked in 2065 |

3. Write a program for the interest charged in installments for following case. A cassette player costs Rs. 2000. A shopkeeper sells it for Rs. 100 down payment and Rs. 100 for 21 more months. What is the monthly interest charged?

6 marks | Asked in 2065 |

Unit 2: Elements of C
4 Questions

2. Find the value of “a” in each of the following statements:

int i=3 , j=4 ,k=8

float a=4.5 ,b=6.5,c=3.5

(a) a = b- i/k +c/k

(b) a = (b-k)/j + (j + c)/k

(c) a = c-(( i + j)/(k + i))*b

(d) a = c – i + j / k+ i * b

(e) a = c + j % 2 +b

(f) a = (b + 1) % (c + 1).

6 marks | Asked in 2065 |

2. Determine which of the following are valid identifiers? If invalid, explain why?

(a) record1 (b)record

(c) file_3 (d) return

(e) #tax (f) name

(g) goto (h) name and address

(i) name-and-address (j) 123-45-6789

(k) Void (l) name_address

6 marks | Asked in 2066

3. Write a program to find the factorial of a given integer.

6 marks | Asked in 2068

7. Write a program to count the number of words in a sentence.

6 marks | Asked in 2067

Unit 3: Input and Output
0 Questions
Unit 4: Control Statement
1 Questions

4. Write a program that uses a “for” loop to compute and prints the sum of a given numbers of squares.

6 marks | Asked in 2065 |

Unit 5: Arrays
1 Questions

5. Write a program to obtain the product of the following matrices and explain it:


6 marks | Asked in 2065 |

Unit 6: Functions
3 Questions

3. Define printf() function, header file and main function. Find the value of following expression. Use the value initially assigned to the variables for each expressions.   [4.5+1.5]

int a = 8, b = 5;

float x = 0.005, y = -0.01;

1) 2 * ((a / 5) + 4 * (b – 3)) % (a + b - 2));

2) (x > y) && (a > 0) || (b < 5);

3) (a > b)?a:b;

6 marks | Asked in 2070 |

6. Write a function to add, subtract, multiply, and divide two complex numbers (x +iy) and (c + id).

6 marks | Asked in 2065 |

6. Write a function to multiply two x matrices.

6 marks | Asked in 2067

Unit 7: Pointers
1 Questions

8. What is a pointer and explain its applications? Write a program that uses pointers to copy an array of double.

OR

Define a pointer. Write a function that is passed an array of n pointers to the maximum of the floats.

6 marks | Asked in 2065

Unit 8: Structure and Union
1 Questions

9. Define a structure of employee having data members name, address, age, and salary. Take data for employee in an array dynamically and find the average salary.

6 marks | Asked in 2065

Unit 9: Files and file handling in C
6 Questions

7. Write a program which will read a line and delete from it all occurrences of the word

“that”.

6 marks | Asked in 2065

8. Discuss different file openings modes. Write a program to read all the numbers from the input file “value.dat” and store only even numbers in an output file named as “result.res”.(2+4)

6 marks | Asked in 2072

9. Write a program to read the data file which has following details.

a. Name      b. Age      c. Test player      d. Total run.

6 marks | Asked in 2071

10. Some text file is given; create another text file replacing the following words “Ram” to “Hari”, “Sita” to “Gita”, and “Govinda” to “Shiva”.

OR

What are the uses of graphical function? Explain the basic graphical function with suitable program.

6 marks | Asked in 2067

10. Write a program to create a file "RECORD.TXT" then store roll no, name and percentage of 10 students. [6]

6 marks | Asked in 2070

10. Given a text file, create another text file deleting the following words “three”, “bad”, and “time”.

OR

Why do you require graphical function? Explain the basic graphical function with suitable program.

6 marks | Asked in 2065

Unit 10: Introduction to Graphics
1 Questions

9. List any five names of graphics function. Write a program to read line of text then count no. of vowels, No. of digits and no. of spaces. [2+4]

6 marks | Asked in 2070 |