C programming exam paper | My CS Tutorial |
Paper Code: 13506
1506
B.Sc. (Computer Science) (Part 1)
Examination, 2017
Paper No. 2.3
BASIC PROGRAMMING CONCEPT USING C
Time: Three Hours][Maximum Marks: 34
Note: Attempt five questions in all selecting at least one question from each Section.
Section-A
1. (a) What are header files and what are its uses in C programming?
(b) What are variables and it what way is it different constants?
2. (a) Differentiate between local and global variables.
(b) How do you declare a variable that will hold string values?
3. (a) What is scope of variable? How are variables scoped in C?
(b) Write a C program to compute the sum of first n terms of the series using ‘for’ loop.
4. (a) What are the control structures in C? Give an example each.
(b) When should we use pointers in a C program?
Section-B
5. (a) When is a “switch” statement preferable over an “if” statement?
(b) Write a loop statement that will show the following output:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
6. (a) What is the difference between functions getch() and getche()?
(b) What are structure types in C?
7. (a) Explain any two dynamic memory allocation functions.
(b) Describe, how arrays can be passed to a user defined function.
8. (a) What is the difference between declaration and definition of a function?
(b) Write a C function is prime (num) that accepts an integer argument and returns 1 if the argument is prime, a0 oterwise. Write a C program that invokes this function to generate prime numbers between the give ranges.
Section-C
9. (a) What is a file? Explain, how the file open and file close functions handled in C?
10. What is the output of this C code?
#include<stdio.h>
int main ()
{
int a[5] = {1,2,3,4,5};
int i;
for (i=0;i<5:i++)
if ((char) a[i] = = ‘5’)
printf(“%d/n”, a[i]);
else
printf(“FAIL/n”);
}
_______________________________________
Please share this post and blog link with your friends.For more programs use this blog.
If you have any problem, please comment in comment box, subscribe this blog for notifications of new post on your email and follow this blog.If you have any method of this tutorial or program or want to give any suggestion send email on hc78326@gmail.com
Created by-- HARSH CHAUHAN
No comments:
Post a Comment