0% found this document useful (0 votes)
26 views

C Programming 2072

Question

Uploaded by

Sailesh Sailesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

C Programming 2072

Question

Uploaded by

Sailesh Sailesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Tribhuvan University

Institute of Science and Technology


2072

Bachelor Level/ First Year/ First Semester/ Science Full Marks: 60


Computer Science and Information Technology (CSc. 111) Pass Marks: 24
(C-programming) Time: 3hours.

Candidates are required to give their answers in their own words as for as practicable.
The figures in the margin indicate full marks.

Attempt all questions


1. Draw a flow chart and write an algorithm to find a number is divisible by either 5 or
7? (6)
2. Discuss logical operators along with the truth table. Write a program using switch
statement to display EXCELLENT, VERY GOOD, GOOD, SATISFACTORY, or FAIL if
the user enters A, B, C,D,E respectively. (3+3)
3. What do you mean by entry-controlled and exit-controlled loop? Write a program to
print the following output.(2+4)
1
01
101
0101
10101
4. Differentiate break statement with continue statement. What is the output if the
following program ?(2+4)
#include<stdio.h>
#include<conio.h>
#include<math.h>

Void main()
{
int x=2, n=5, sum=0, i;
clrscr();
for(i=1; i<=n; i++)
{
If(i%2==0)
Sum==sum-pow(x,i);
else

Downloaded from CSIT Tutor


sum=sum+pow(x,1);
}
Printf(“sum=%d”,sum);
Getch();
}
5. Explain pass by value and pass by reference with suitable example of each. (6)
6. What is array? Write a program to find the sum of each row of 3*2 matrix.
7. What is dynamic memory allocation? Write a program to find sum and average of n
numbers entered from the keyboard using dynamic memory allocation to create array
to store these n numbers.(2+4)
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)
9. Discuss with example any five graphics function used in c-programming. (6)
10. Write short notes on:
a) Documentation
b) structure

Downloaded from CSIT Tutor

You might also like