Tuesday, September 8, 2015

BSc. CSIT/First Semester/CSc-102: Fundamental of Computer Programming

NEW SUMMIT COLLEGE
Second Internal Examination
2013
Time: 3 Hrs.                                                                                                                                        F.M.: 100

Group “A”
[54 Marks]
1.       What is meant by Identifiers? How a user is defined Identifier different from a standard (reserved) Identifier?  [6 marks]
2.       Define three constants used in C. [6 marks]
3.       What is a statement? Define three types of statements. [6 marks]
4.       Write a program to read any two floating point numbers from the keyboard and to display their addition, subtraction, multiplication and division. [6 marks]
5.       Differentiate between getchar() and putchar(). [6 marks]
6.       Define if-else statement with an example. [6 marks]
7.       Write a program to display the name of the day, depending upon the number entered from the keyboard using switch-case statement. [6 marks]
8.       What will be the output of the following program? [ 3+3 = 6 marks]
a.        main(){
int x=4, y=0,z;
if(x==y)
break;
else
printf(“\n%d %d”,x,y);
x--;
y++;
}
                       }
b.       main(){
int i;
i=0;
for(i<=4)
printf(“%d\t”,i++);
}
9.       What is variable? Why it is important in C programming? [4 marks]

Group “B”
[48 Marks]
10.    Define for loop. Write a program to find the sum and average of the given number using for loop. [12 marks]
11.    Define while and do-while loop. Write a program to find the sum of the first 100 natural numbers. [12 marks]
12.    Write a program to find the sum and average of the given numbers using the do-while loop. [12 marks]

13.    What is structure? Write a program to declare the same name for the different data types in the two structures and to assign same values into the corresponding fields and to display the contents of the structures. [12 marks]
Full Marks: 60
Time: 3 hrs
 
ORCHID INTERNATIONAL COLLEGE
Sinamangal-9, Kathmandu
Pre-Board Exam
2069
BSc. CSIT/First Semester/CSc-102: Fundamental of Computer Programming


Candidates are required to give their answers in their own words as far as practicable.

All questions carry equal marks.
Attempt all questions.                                                                                                                 [10×6=60]

1.      Draw a flowchart to find out the largest among 3 numbers (using nested if-else statement).
2.      Find the error in the given program and explain it. Write the correct program.
#include<stdio.h>
#include<math.h>
Main
{
flaot  p,r,n;
printf(“please enter the value for the principal(p):”);
scanf(%f,&p):
printf(“please enter the value for the interest(r));
scanf(“%f”,&r);
printf(“please enter the value for the number of years(n):”);
scanf(“%f,n):
= p*pow + r/100),n);
Printf(\n the final value(f) is : %.2f\n”,f);

3.      Write a program that uses a “for “ loop to compute and prints the sum of a given numbers of cubes.
[ hint : For example, if 4 is input, then the program will prints 30, which is equal to 13 + 23 + 33 + 43 ]
4.      Write a program to concatenate two strings without using string library function.
5.      Why structure is required ? make a program using structure of booklist having data members title, author and cost. Enter n data and print all data in ascending order of names of author.
6.      What do you mean by identifier and keyword? Explain all the rules for defining a variable .
7.      Explain about different types of operators.
8.      Write a program to add two array of size 2 x3 and display result in matrix form.
9.      Differentiate between compiler, interpreter and assembler.
10.  Write a program to find HCF  and LCM of two number entered by user. 

No comments:

Post a Comment