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

Programming in C

This describes brief about C programming

Uploaded by

Raj Ghimire
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Programming in C

This describes brief about C programming

Uploaded by

Raj Ghimire
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

POKHARA UNIVERSITY

Level: Bachelor Semester : Spring Year : 2023


Programme: BE Full Marks: 100
Course: Programming in C Pass Marks: 45
Time : 3hrs.

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

1. a) What are the properties of a good algorithm? Write an algorithm and 8


draw a neat flowchart to input a number and check whether it is even
and divisible by 3.
b) Write the rules of naming variables. How is a variable declared and
7
initialized in compile time and run time? Explain with example.
2. a) How does else-if ladder work? Explain with its general syntax, 8
flowchart and a simple program.
b) Compute the total labor cost for building wall of 50 meter long, 0.2 7
meter wide and 7 meter tall. The length of a brick is 10cm, height is
8cm and width is 6cm. Cost of one brick join in 1.50 paisa.
(Assume the thickness of mortar is negligible.)
3. a) Write a program to find the sum of n terms of the series : 7
1+x+x3+………+xn , by asking the values of n and x from user.
b) What is the advantage of an array over a variable? Write a program to 8
read 4×4 matrix, compute and print the sum of all elements.
4. a) What are the header files? Explain their roles in a program. 7
b) What is a recursive function? Write a recursive function to generate the 8
10 terms of Fibonacci sequence starting from 0 as first term and 1 as
second term.
5. a) Write a program to pass the elements of an array to a function using 7
pointer and use the function to find the sum of the elements and print
the sum.
b) How is memory allocated dynamically in C? Explain with a simple 8
program.

1
6. a) Create a structure called student with data members name, rollno and 8
college for 10 students. Display the name of the students who study at
SoE.
b) What are the different file opening modes? Explain the role of FILE 7
pointer, fopen (), and fclose () functions with a simple program.
7. Write short notes on: (Any two) 2×5
a) Programming Languages
b) String Functions
c) Advantages of Functions

You might also like