USN 1 S I ESCO5
Siddaganga Institute of Technology, Tumakuru-572 103
(An Autonomous Institution affiliated to VTU, Belagavi, Approved by AICTE, New Delhi)
Bachelor of Engineering Supplementary Examinations Aug - Sep 2024
Introduction to C Programming
(Except CS, IS, AD, CI, BT)
Time: 3 Hours Max. Marks: 100
Note : 1. Revealing of Identity in any form in the answer book will be treated as malpractice.
2. Answer any five questions choosing one full question from each unit.
Unit - I M BL CO PO PSO
01 a) Explain the formatted input/output functions supported in C with syntax and
suitable example. 6 2 1 2 1
b) Write structure of C program, and explain files used in a C program. 7 2 1 2 1
c) What is a token? What are different types of tokens available in C language?
Explain with example. 7 3 1 2 1
OR
02 a) What are constants? With examples explain different types of constants. 4 3 1 2 10
b) Define computer with the neat block diagram. Explain all units of a computer. 7 3 1 2 1
c) What is an identifier (variable)? What are the rules to construct
identifier(variable)? Classify the following as valid/invalid identifiers with reason.
i) Num2 ii) $num1 iii) +add iv) a_2
v) 199_space vi)_apple vii) #12 viii) int 9 3 1 2 1
Unit - II
03 a) Write a C program that takes from user an arithmetic operator: ( +, -, *, / ) and two
operands. Perform corresponding arithmetic operation on the operands using
switch statement. 5 3 2 2 1
b) Write the general syntax of for loop construct in C. Also develop a C program to
generate and print first N Fibonacci numbers. 7 3 2 1 1
c) Explain the following operators with example:
i) Bitwise operators ii) Logical operators iii) Shift operators
iv) increment/decrement 8 3 2 2 1
OR
04 a) Develop C program to print the following pattern using nested loop:
*
**
***
****
***** 5 2 2 1 1
b) Differentiate between entry-controlled loop and exit controlled loop with syntax
and example. 9 3 2 2 1
c) Write the syntax of ternary operator and Develop C program to find maximum of
two numbers using ternary operator. 6 3 2 1 1
Unit - III
05 a) Write a program in C using functions to swap two numbers using:
i) Call by value ii) Call by reference 10 3 3 2 1
b) What is recursive function? Write a C program to compute GCD of two numbers
N1 and N2 using recursive function. 6 2 3 1 1
-1- Please Turn Over
-2- ESCO5
c) Explain scope of variable in C. 4 2 3 1 1
OR
06 a) Develop a C program to sort the given set of N numbers using Bubble sort.
Print the input array and the resultant array with suitable messages. 8 3 3 2 1
b) Develop C program to read an array and then to perform linear search.
Display whether the key element is present or not. 5 3 3 2 1
c) Develop C program to demonstrate passing an array to a function that returns the
maximum element present inside the array. 7 2 3 1 1
Unit - IV
07 a) Develop C program to concatenate two strings without using built-in function
strcat(). 8 3 4 2 1
b) Define multi-dimensional array. Declare 3D array with size [3][3][3] and explain
the initialization of an array at compile time and run time with example. 7 3 4 2 1
c)Write a program to enter a 2D array and print the transpose of the array. 5 3 4 1 1
OR
08 a) Write a C program that accepts ( 3×3 ) ordered matrices A and B and compute the
following i) summation of two matrices ii) subtraction of two matrices. 6 3 4 2 1
b) Write an algorithm and develop a C program that reads N integer numbers and
arrange them in ascending order using selection sort. 6 3 4 2 1
c) Explain unformatted input/output functions used to read and print a string with
example for each. 8 3 4 2 1
Unit - V
09 a) Develop a C program using pointers to compute the sum, mean and standard
deviation of all elements stored in an array of N numbers. 7 3 5 2 1
b) Write a ‘C’ program to copy one string into another
i) without using strcpy function ii) using strcpy function 7 3 5 2 1
c)With syntax and example, explain how to declare and initialize a structure
variable. 6 3 5 2 1
OR
10 a) Define a structure ‘student’ with members as name, USN and marks. Develop C
program to read, write, compute average marks and display the students scoring
above and below the average marks for a class of N students. 8 3 5 2 1
b) Define string. Explain any three string handling functions with suitable example. 7 3 5 2 1
c) Write a program to accept string and checks for palindrome or not using built in
functions. 5 3 5 2 1
________