Tuesday, September 8, 2015

Fundamentals of Computer Programming

Asian School of Management
Samakhushi, Kathmandu
Pre-Board Examination 2013
                                                                                   
B.Sc. CSIT/First Year/First Semester                                                        Full Marks: 60
Time: 3 hours                                                                                           Pass Marks: 24
CSC 102: Fundamentals of Computer Programming

Attempt all questions (10*6=60)

  1. Define algorithm and flow chart. Draw a flow chart to find and print the largest of the three input numbers.

  1. Explain the nested if-else statement and switch statement with suitable example.

  1. What are different loops available in C language? Explain each of them with example.

  1. What do you mean by a function? How arguments can be passed in function explain with suitable example.

  1. What is a pointer? Explain the use of pointer for dynamic memory allocation.

  1. What is recursion? Write a program to compute the ab  using recursive function where a and b are the inputs.

7.      Write a program to transpose a m x n matrix and show the input matrix and its transpose.

  1. What is a structure and how structure are created? Explain the syntax and uses of self referential structure.

  1. Write a program defining a structure named “Employee”  with field  emp_name, emp_id,emp_address, contact_no as string and salary as float. Create an array of 10 Employee and input the data and show the employee data as:
S.No:   Name   Address           Salary  Contact No
1.         Ram     Kathmandu     23000  9846255668
2.         Hari     Lalitpur           40000  9845685214    etc.

10.  Write a program that reads a text file and deletes each occurrence of the word “the”.
OR
Write a program that reads a file and prints from reverse.


*****
Kathmandu BernHardt College
Bafal, Kathmandu
Pre-Board Examination -2069

Faculty:  Science                                                   Set-‘A’                                                   FM: 60   
Subject: Fundamental of Computer Programming (102)                                                PM:  24
Level: CSIT 1st Sem.                                                                                                             Time:3hrs

Attempt all Questions.
1.    Why flowchart is required? Explain different symbol used in flowchart and draw a flowchart to read a number and check whether the number is prime or not.      [1+2+3]
2.    Write short notes on any six:                                                                                   [1×6=6]
a)   Variable
b)   Escape sequence
c)    Increment and decrement operator
d)   Keywords
e)    Data type
f)    Symbolic constant
g)    getchar() and putchar() function.
h)   printf() and scanf() function.
3.    Explain syntax and semantic of  else if (ladder) statement. And write a program to print all the leap year between 1990 to 1012.                                                                            [2+4]
4.    What is loop? Explain the syntax and semantic of do while loop. Write a program that uses do…while loop to reverse a number.                                                       [1+2+3]
5.    Write a program to multiply two n×n matrices using function.                        [6]
6.    Write a program to count the numbers of vowels, consonants, digits, space and others characters in a sentence. (using function and pointer)
7.    Write a program that will read a line and delete all the occurrences of word "bad" from line.                                                                                                         [6]
8.    Why pointer is called jewel of C language? Write a program that uses pointers to copy an array of int.                                                                                                                      [6]
OR
Define pointers. Write a program to read name of n cities using pointer and sort them in alphabetical order.
9.    Define a structure for employee with member name, address, age and salary. Take data for n employee dynamically. Find average salary.                                          [6]          
10. Some Text file is given, Create another text file replacing the following words “computer” to “television” and “good” to “bad”.                                      [6]
OR
What are the uses of graphical function? Explain the basic graphics function with suitable program.

GOOD LUCK

Kathmandu BernHardt College
Bafal, Kathmandu
Pre-Board Examination -2069

Faculty:  Science                                                   Set-‘B’                                                   FM: 60   
Subject: Fundamental of Computer Programming (102)                                                PM:  24
Level: CSIT 1st Sem.                                                                                                             Time:3hrs

Attempt all questions. All questions carry equal marks.
1.     What an algorithm and flow chart to find out whether a given integer is zero, +ve or –ve and explain it.                                                                                            [3+3]
2.                What is variable? How can you declare the variable in C? Explain with example.                [2+4]
3.       Explain the syntax and semantic of do while loop. And write a program to find sum of   square of first n natural numbers.                                                                                  [2+4]
4.       What is recursion? Write a program to find GCD of two number using recursive definition.                                                                                               [2+4]
5.       What is string? Write a program to check whether a number is palindrome or not without using library functions.                                                        [2+4]
6.       Explain the multidimensional array with example. Write a program to convert uppercase character string into lowercase.                                                                [2+4]
7.       Differentiate between break and continue statement. Write a program to print all prime between 1 to 100.                                                                                   [2+4]
8.       Why pointer is called jewel of C language? Write a program that uses pointers to copy an array of integer.                                                                                   [2+4]
OR
Explain the importance of pointer. Write a function that is passed an array of n pointers to floats and return a newly created array that contains those n float values.
9.       Define a structure of student having data member name, address, marks in C language and marks in information system. Take data for n students in an array dynamically and find the total marks obtained.                                                                         [6]
10.    Replace the words “Ram” to “Hari”, “Sita” to “Gita”, “Govinda” to “Shiva” in the file "myfile.txt".                                                                                                               [6]
OR
 What are the uses of graphical function? Explain the basic graphical function with suit
                 
GOOD LUCK

No comments:

Post a Comment