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

19AI305 -Advanced c programming-nov 2024updated (1)

Uploaded by

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

19AI305 -Advanced c programming-nov 2024updated (1)

Uploaded by

gayukalai67
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Question Repository for Nov 2024 Examinations

Common To
Course Code 19AI305 Course Name Advanced C Programming
Mention the
Faculty Name Mr. Nagendran Department AI&DS Branches here

(PART A – 2 Marks)
UNIT - I
Knowledge
Difficulty
Q. No Questions CO Level
Level (1-5)
(Blooms)

Compare the for, while loop and do-while. CO


QA101 K2 2
1

Write a program to initialize the value as 7680 & display the value CO
QA102 on the monitor. 1 K6 2

CO
Illustrate the C Programming Structure.
QA103 1 K2 2

QA104 Produce the output for the following C program CO K4 3


#include<stdio.h> 1
int main()
{
int i=0;
for(; ;)
{
printf("%d”, i);
return 0;
}

CO
QA105 Write a C program to find area and circumference of circle. K6 3
1

CO
QA106* How to declare a constant in C? K2 2
1

How to modify the loop control variable within the loop body? CO
QA107* K2 2
Provide an example. 1

What is the way to print a formatted string to the standard output CO


QA108* K2 2
in c? 1

UNIT – II
Knowledge
Difficulty
Q. No Questions CO Level
Level (1-5)
(Blooms)

CO
Discuss the types of arguments passing in C.
QA201 2 K2 2

Compare the pointer and pointer to pointer variable with suitable CO


QA202 example. 2 K2 2
Write a C program to print the address of variable, pointer and
CO
pointer value.
QA203 2 K6 2
(Assume “i” is variable and “p” is pointer )

Write a C program to find greatest among three numbers using


QA204 CO2 K6 2
functions (Without argument and with return type)

QA205 Write a C program to multiply two numbers using pointers CO2 K6 2

CO
Describe the process of accessing the value stored at the memory
QA206* 2 K2 2
address indicated by a pointer.

CO
QA207* How to return multiple values from a function? 2 K2 2

CO
QA208* List the two main components of a recursive function. 2 K2 2

UNIT - III
Knowledge
Difficulty
Q. No Questions CO Level
Level (1-5)
(Blooms)

Illustrate the Array and how to initialize an array? CO


QA301 K2 2
3

CO
Determine 3-Dimensional Array and indexing with neat diagram.
QA302 3 K2 2

Predict the output for the following C program


#include <stdio.h>
int main()
{
int array[5]= {10,30,50,70,80};
int i = 0,n=5,ele=30,j=0;
while( j < n)
{ CO
QA303 if( array[j] == ele ) 3 K4 3
{
break;
}
j = j + 1;
}
printf("Found element %d at position %d\n", ele, j+1);
return 0;
}

CO
Create a C program to read n elements as input and print the sum of
QA304 3 K6 3
all elements of the array (integer).
List the differences between searching and sorting techniques CO
QA305 K2 2
3

Write a function to segregate an array of 0's and 1's by traversing the


CO
QA306* array only once. K6 3
3

Explain whether it is possible to modify the size of an array during CO


QA307* K2 2
runtime. 3

CO
QA308* Distinguish between int[] a and int a[]? K2 2
3

UNIT - IV
Knowledge
Difficulty
Q. No Questions CO Level
Level (1-5)
(Blooms)
CO
QA401 Define structure with an example. K2 2
4

Produce the output for the following program


#include<stdio.h>
int main()
{
struct saveetha
CO
{
QA402 4 K4 3
char *ptr;
int born;
};
struct saveetha l1 = {"nagu", 1981};
printf("%s %d", l1.ptr, l1.born);
}6

CO
QA403 Define self-referenced structure with an example. 4 K2 2

Predict the output for the following program


#include<stdio.h>
int main()
{
union test
CO
{
QA404 4 K4 3
int i;
int j;
};
union test var=10;
prinf(“%d,%d\n”,var.i,var.j);
}
CO
QA405 How can you represent a linked list node in C program? 4 K2 2

CO
Describe whether structures can include other structures as
QA406* 4 K2 2
members and explain the method for doing this.

CO
Mention the method for determining the length of a linked list using
QA407* 4 K2 2
a recursive approach

CO
QA408* How to modify a singly linked list into doubly linked list? 4 K4 2

UNIT - V
Knowledge
Difficulty
Q. No Questions CO Level
Level (1-5)
(Blooms)

CO
QA501 Write a program to find sum of two fraction values K2 62
1
CO
QA502 Write a C program to find the length of the string “saveetha” . K2 2
1

CO
QA503 Define Conditional Operator with an example? K2 2
1

Write a C program to concatenate two strings without using strcat() CO


QA504 K6 2
using while loop. 2

CO
QA505 Write a C program to find the ASCII value of &. K6 2
2

CO
QA506* How to find the first occurrence of a character in a string in C? K2 2
2

CO
QA507* What are the consequences of not initializing an array? K2 2
3

CO
QA508* What does the `&` operator do when used with a variable? K2 2
2
(PART B – 13 Marks - Either Or Type)

UNIT - I
Knowledge
Difficulty
Q. No Questions CO Level
Level (1-5)
(Blooms)
Write a program in C to read any Month Number in integer and
display Month name in the word.
For example:
Inp
Result CO
QB101 (a) ut K6 3
1
12 December

7 July

(Or)
Write a program to find if a given number is positive or negative
or zero using ladder if.

Sample Sample Output


Input
CO
QB101 (b) 200 Number is K6 3
1
positive
-300 Number is
negative
0 Number is equal
to 0
QB102 (a) Debug the C Program to print square number pattern of one and CO K6 3
zero with one at odd row and zero at even row using loop. 1
Example
Input
Input rows: 5
Input columns: 5
Output
00000
*****
00000
*****
00000

(Or)
Write a C program to read the value of an integer m and display
the value of n as follows.
n is 1 when m > 10
n is 0 when m is 10
n is -1 when m < 10
For example:
CO
QB102 (b) Inp K6 3
Result 1
ut

10 The value of m
= 10
The value of n
=0
Write a C Program to simulate the bitwise operators(&, | ) using
the switch statement
For example:
Input Result
CO
QB103 (a) K6 4
10 & Result = 1
40 8

10 | Result =
40 42
(Or)
QB103 (b) Write a C program for the following pattern: CO K6 4
% 1
%%
%%%
%%%%
%%%
%%
%

Write a C program to that receives a string as input and checks


CO
QB104 (a)* whether it is a valid email address format using loops. K6 3
1

(Or)

Implement a C program for simple color mixer using switch


CO
QB104 (b)* case, which takes two primary colors (red, blue, yellow) as input K6 3
1
and prints the resulting secondary color (orange, purple, green).

UNIT - II
Knowledge
Difficulty
Q. No Questions CO Level
Level (1-5)
(Blooms)
Given a string consisting of alphabets and digits, write a C
program to find the frequency of each digit in the given string CO
QB201 (a) K6 3
using functions. 2

(Or)

Write a C function int max_of_four(int a, int b, int c, int d) which CO


QB201 (b) K6 3
reads four arguments and returns the greatest of them. 2

Given the number of students, their scores in three subjects, and


CO
QB202 (a) the weights of these subjects, write a C program to calculate the K6 3
2
total score of each student and print it using pointers.

(Or)
Given three integers A, B, and N, develop a C code to find the Nth
term of the modified Fibonacci sequence, where each term is the CO
QB202 (b) K6 3
sum of the squares of the previous two terms using recursive 2
function.

Given an integer n, we define superDigit(n) as the sum of digits


of n and also given an integer k. write a C program to find CO
QB203 (a) K6 3
superDigit(p) where p is created by concatenating n k times 2
using recursive function
(Or)
Given an array of integers and a positive integer k, develop a C
CO
QB203 (b) program to find and print the number of pairs where i < j and K6 3
2
arr[i] + arr[j] is evenly divisible by k using functions.

Write a C program to implement a function that receives an


CO
QB204 (a)* array of strings as input, sorts the strings in lexicographical K6 3
2
order and prints the sorted strings.

(Or)

Develop a C program to implement a function that receives an


CO
QB204 (b)* integer as input, checks whether it is a palindrome using K6 3
2
pointers and prints a message indicating its palindrome status.

UNIT - III
Knowledge
Difficulty
Q. No Questions CO Level
Level (1-5)
(Blooms)
Given an array of integers, write a C program to calculate the
fractions of its elements that are positive, negative, and are CO
QB301 (a) K6 3
zeros. 3

(Or)
Given an array of n integers and a number, d, develop a C
program to perform d left rotations on the array. Then print the
CO
QB301 (b) updated array. K6 3
3

Write a C Program to get the 6 subject marks from the user


CO
QB302 (a) using array and display the average of the student in float. Also K6 3
3
write the output for this program.

(Or)
Given an array of n integers ,develop a C program to reorder the
array such that the even integers appear first followed by the odd CO
QB302 (b) K6 3
integers, while maintaining the relative order of even and odd 3
integers.
Write a C Program to arrange the following values 15, 22, 30, 10,
18, 64 in descending order using bubble sorting technique.
Before bubble sorting the elements are: CO
QB303 (a) K6 3
15 22 30 10 18 64 3
After bubble sorting the elements are:
64 30 22 18 15 10
(Or)
Write a C Program to arrange the given array 125, 181, 130, 25,
61, 887 in ascending order using merge sorting technique.
Before merge sorting the elements are: CO
QB303 (b) K6 3
125 181 130 25 61 887 3
After merge sorting the elements are:
25 61 125 130 181 887
Write a C program to implement a function that receives an
CO
QB304 (a)* array of integers as input and calculates the frequency of each K6 3
3
element.

(Or)
Given an array of integers and implement a C program to
implement a function that receives an array of integers as input CO
QB304 (b)* K6 3
and calculates the sum of the absolute differences between 3
consecutive elements.
UNIT - IV
Knowledge
Difficulty
Q. No Questions CO Level
Level (1-5)
(Blooms)

Build a C Program for Single Linked List with Create () and CO


QB401 (a) K6 4
delete the node containing the given value from the linked list. 4

(Or)

Given the head pointer of a doubly linked list, write a C program


CO
QB401 (b) to find and return the middle node of the list. If the list has an K6 4
4
even number of nodes, return the second middle node.

Create a C Program for reverse the doubly linked list and return CO
QB402 (a) K6 4
the head pointer of the reversed list 4

(Or)

Given the head pointers of two single linked lists, develop a C


CO
QB402 (b) code to determine if the linked lists are equal and having the K6 4
4
same elements in the same order.
Implement a C Program for Double Linked List with Create
CO
QB403 (a) () ,Deleteatbegin() Deleteatend () and Display () operations. K6 4
4

(Or)

Build a C Program for Single Linked List with Create () and CO


QB403 (b) K6 4
InsertLast () operations. 4

Define a C function that takes two doubly linked lists as input


and concatenates them, i.e., appends the second list to the end of
CO
QB404 (a)* the first list. The function should return the concatenated linked K6 4
4
list. Develop a c program to implement a function that concate-
nates two doubly linked lists.
(Or)
Write a C function that takes a singly linked list containing inte-
ger data as input .Implement a c program to implement a func- CO
QB404 (b)* K6 4
tion that checks whether a singly linked list is sorted in non-de- 4
creasing order.

UNIT - V
Knowledge
Difficulty
Q. No Questions CO Level
Level (1-5)
(Blooms)
Write a C Program to take two numbers as input from the user
and then calculating the following with ternary operator. CO
QB501 (a) K6 3
1. check whether the numbers are equal or not. 1
2. find the smallest of two numbers
(Or)
Write a C program to read temperature in centigrade and display
a suitable message according to temperature state below : Temp CO
QB501 (b) K6 3
< 0 then Freezing weather, Temp 0-20 then Very Cold weather, 1
Temp 20-30 then Cold weather, Temp 30-40 then Normal in
Temp, Temp 40-50 then Its Hot, Temp >=50 then Its Very Hot

Write a C program to read the wind speed in kph and display a


suitable message according to the wind speed state below.(use
ELSE-IF ladder) * Strong breeze at 39-49 kph (25-31 mph) * CO
QB502 (a) K6 3
Moderate gale at 50-61 kph (32-38 mph) * Fresh gale at 62-74 2
kph (39-46 mph) * Strong gale at < 98 kph

(Or)
Create a C program to check whether the given number is
Armstrong number and or not and find and print all Armstrong CO
QB502 (b) K6 3
numbers between two given numbers using for loop. 2

Given an array of student grades, develop a C program to round


up grades less than 40 to the next multiple of 5 if the difference CO
QB503 (a) K6 3
between the grade and the next multiple of 5 is less than 3. 3

(Or)
Given an unordered array of consecutive integers from 16 to n
with no duplicates, develop a C program to find the minimum CO
QB503 (b) K6 3
number of swaps required to sort the array in ascending order. 3

Define a C function that takes a singly linked list as input and


CO
QB504 (a)* Develop a c program to implement a function that counts the K6 3
4
number of nodes in a singly linked list.
(Or)

Create a C program that takes an array of integers as input and


finds the smallest missing positive integer in the array. The CO
QB504 (b)* K6 3
program should return the smallest missing positive integer. 3
(PART C – 15 Marks - Either Or Type)

UNIT - I
Knowledge
Difficulty
Q. No Questions CO Level
Level (1-5)
(Blooms)
Write a C program to compute the average distance traveled per
day, given the total distance traveled and the number of days CO
QC101 (a)* K6 4
over which the distance was traveled. 1

(Or)
Implement a C program which calculates the income tax for an
individual based on the following tax slab rates in India for the fi-
nancial year .

 Income up to 2,50,000: No tax


 Income from 2,50,001 to 5,00,000: 5% of income exceeding
CO
QC101 (b)* 2,50,000 K6 4
1
 Income from 5,00,001 to 10,00,000: 12,500 plus 20% of in-
come exceeding 5,00,000
 Income above 10,00,000: 1,12,500 plus 30% of income ex-
ceeding 10,00,000
UNIT - II
Knowledge
Difficulty
Q. No Questions CO Level
Level (1-5)
(Blooms)
Create a C program for a simple hotel billing system. The
program will handle basic operations such as calculating the CO
QC201 (a)* K6 4
total bill based on the number of nights stayed and the room rate 2
using functions
(Or)

Develop a C program to print a butterfly pattern using asterisks


CO
QC201 (b)* (*) where the user specifies the number of rows. The pattern K6 4
2
should resemble the wings of a butterfly

UNIT - III
Knowledge
Difficulty
Q. No Questions CO Level
Level (1-5)
(Blooms)
Write a C program that accepts an array of strings, generates all
possible permutations of each string by reversing characters, CO
QC301 (a)* K6 5
and then prints each permutation 3

(Or)

Develop a C program to implement a function that receives an


CO
QC301 (b)* array of integers as input and finds the index of the peak element K6 4
3
(an element that is greater than its neighbors).
UNIT - IV
Knowledge
Difficulty
Q. No Questions CO Level
Level (1-5)
(Blooms)
Given a single linked list, write a C program to detect a cycle in a
QC401 singly linked list, use two pointers to determine if there is a cycle CO K6 4
(a)* exists. 4

(Or)
Design and implement a C program for an order management
QC401 system using a doubly linked list. Implement methods to add an CO
K6 5
(b)* order, delete an order and process an order. Use a doubly linked 4
list where each node represents an order.

UNIT - V
Knowledge
Difficulty
Q. No Questions CO Level
Level (1-5)
(Blooms)
Design a C program to manage student records using a singly
linked list. Each student record should contain the student ID,
CO
QC501 (a)* name, and grade. Implement methods to add a student, delete a K6 5
4
student, update a student's grade, and display all student
records.
(Or)
Write a C program to find the longest common prefix string
among an array of domain names. If the list is empty, return an CO
QC501 (b)* empty string. If there is no common prefix, return "No common K6 4
3
prefix”

Knowledge Level (Blooms Taxonomy)


Applying
K1 Remembering (Knowledge) K2 Understanding (Comprehension) K3
(Application of Knowledge)

K4 Analysing (Analysis) K5 Evaluating (Evaluation) K6 Creating (Synthesis)

General Instructions

(i) For each Question, mention K1 or K2 etc. for Knowledge Level

(ii) For each Question, mention CO1, CO2 etc. for Course Outcomes.

Verify the COs with the Syllabus (Avl in Website) before framing the Questions.

An Either or type Question should have same CO in both (a) and (b) parts.

(iii) For each Question, mention any number from 1 to 5 for Difficulty Level

(With 1 as Most Easy & 5 as Most Difficult)

(iv) Mark with * near the Q.No for those Questions which are framed newly and were not included

in the QRs of LAST TWO SEMESTERs. Ensure minimum 2 new updations per unit in all Parts - PartA,

PartB & PartC. Hods are requested to maintain the QRs of each semester in a common drive and the same shall

be shared to all Faculty members of their Dept. If any subject is NEW (Introduced First time) or if all the

Questions are totally new , kindly mention that on the TOP of the Question Repository.
(v) Kindly Mention NOV 2024 on the Top without fail and allot split up of marks for subdivisions.

(vi) DO NOT Copy and Paste Equations as Images.

All Mathematical Equations should be typed using the appropriate tools.

(vii) Type the Answer Key in the same QR template across the respective Q.Nos and delete the last 3 columns

(CO,KL, Diff level) in the Answer Key file....

You might also like