You are on page 1of 2

AKGEC/IAP/FM/02

Ajay Kumar Garg Engineering College, Ghaziabad


Department of IT
Pre-University Test
Course: B.Tech Semester: I
Session: 2019-20 Section: S-10,17
Subject: Programming for problem solving Sub. Code: KCS-101
Max Marks: 100 Time: 3 hour

Section-A
A. Attempt all the parts.
(10 X 2 = 20)
1.Draw the memory hierarchial structure of computer system.
2. What will be the output of this:
#include<stdio.h>
int main()
{ int a, b = 10; a = -b--;
printf("a = %d, b = %d", a, b);
return 0; }
3.What are functions?What is the advantage of using multiple functions in program?
4. What will be the output of this:
include <stdio.h>
int main()
{ int a = -3, b = -8; // a and b both negative
printf("%d", a % b);
return 0; }
5.How to use break statement in C?Explain with code.
6.What do you mean by precedence and associativity while solving some arithmetic expression.
7.Define notations of order of complexity.
8.Differentiate between structure and union.
9.What do you mean by recursion?
10.Differentiate between function and Macro.

Section-B
B. Attempt Any Three
(3X 10 = 30)
11. Write a program to check the number is palindrome or not.The program should accept any
arbitrary number typed by the user
12.What is meant by storage class of a variable?Define all types of storage class with example.
13.What do you mean by Call by value and Call by reference?Write an algorithm for swapping two
numbers using call by reference technique.also write C program.

14.Explain selection sort Technique for sorting problem?also write an algorithm for selection sort.Sort
the following numbers using selection sort technique.
15. Write an algorithm to print all the even numbers and odd numbers between any given two
integers N1 and N2 (N1 < N2) and print the sum of all even numbers and odd numbers.

Section-C
C. Attempt allthe parts.
(5 X10 = 50)
16. Attempt Any One
a) Explain various operations defined on arrays. WAP to perform Insertion Sort on an integer array.
b) WAP to perform multiply two matrices(read size and number of element of matrices from the
keyboard.

17. Attempt Any One


a) What are structures in C? Write a program to create a structure for employee having data as their
name, employee id, salary and department. Create data for 10 employees and print the same.
b) What do you mean by searching? Discuss different searching algorithm and give example of any
one.

18. Attempt Any One


a) Write short note on:
(i) High level language and low level language.
(ii) Linker and loader.

b)Explain the syntax and use of following directives with examples:


(i) #ifndef (ii) #undef (iii) #pragma

19. Attempt Any One


a) What do you mean by dynamic memory allocation? Explain different functions for dynamic
memory allocation along with their syntax.
b)List out various file operations and modes in C. write a program to copy the content from one file to
another file.

20. Attempt Any One


a) What is stringExplain any five string functions with example.

b) A five digit positive integer is entered thorough keyboard. Write a function to calculate sum of
digits of the 5-digit number:
a. Without recursion
b. With recursion.

You might also like