Basic Programming Skills Past Paper PDF

Summary

This document contains a question bank for a modular test in basic programming skills. It covers topics such as functions, arrays, and recursion. The questions are categorized and details marks, CO (competency objectives) and BTL (Bloom's Taxonomy Levels).

Full Transcript

# Question Bank 2024-25 ## GIFT (Autonomous) Bhubaneswar ## Basic Programming Skills - (BTBS-T-BS-103) ## MODULAR TEST –II Question Bank | Questions | Marks | CO | BTL | |---|---|---|---| | Define a function. List out its advantages. | 2 | 1 | 1 | | Distinguish user defined functions and predefi...

# Question Bank 2024-25 ## GIFT (Autonomous) Bhubaneswar ## Basic Programming Skills - (BTBS-T-BS-103) ## MODULAR TEST –II Question Bank | Questions | Marks | CO | BTL | |---|---|---|---| | Define a function. List out its advantages. | 2 | 1 | 1 | | Distinguish user defined functions and predefined functions. | 2 | 1 | 1 | | What is function prototype? Give example. | 2 | 1 | 1 | | What is function definition? Give Example. | 2 | 1 | 1 | | What is function call? Give Example. | 2 | 1 | 1 | | What is call by value concept? | 2 | 1 | 1 | | What is call by reference concept? | 2 | 1 | 1 | | How does function return a value? Give example. | 2 | 1 | 1 | | List out the steps to be followed to design and calling a function successfully. Briefly describe each step. | 2 | 1 | 1 | | List out all possible benefits of working with functions. | 2 | 1 | 1 | | How does a function call occurs? Describe briefly. | 2 | 1 | 1 | | What is an array? Give some (at least 5) suitable examples where array is required. | 2 | 1 | 1 | | What are different types of arrays? Discuss briefly. | 2 | 1 | 1 | | How to work with 2D array? | 2 | 1 | 1 | | What is recursion? Give an example. | 2 | 1 | 1 | | What is storage classes? | 2 | 1 | 1 | | Discuss Automatic storage class. | 2 | 1 | 1 | | Discuss External storage class. | 2 | 1 | 1 | | Discuss Static storage class. | 2 | 1 | 1 | | Discuss Register storage class. | 2 | 1 | 1 | | Discuss how character array differs from a string variable. | 2 | 1 | 1 | | List out few real-time applications of recursion (at least 10). | 2 | 1 | 1 | | int a[]= {12, 3, 5, 6, 60, 20, 40};<br>printf("%d\n", a[a[a[a[1]+3]-38]]);<br>printf("%d\n", a[a[a[a[1]*2]]/10]*2); | 2 | 1 | 1 | | Output? | | | | | Illustrate array initialization. | 2 | 1 | 1 | | Differentiate array and variable | 2 | 1 | 1 | | What are actual and formal parameters? | 2 | 1 | 1 | | Discuss importance of return statement in a function definition. | 2 | 1 | 1 | | Discuss predefined functions printf() and scanf(). | 2 | 1 | 1 | | #include<stdio.h><br>void fun( int num, int x)<br>{<br>num++;<br>x++;<br>return;<br>}<br>int main()<br>{<br> int i= 5, a[]={11, 22, 33};<br>printf("%d\t%d\n", i, a[1]);<br>fun(i);<br>printf("%d\t%d\n", i, a[1]);<br>return 0;<br>} | 2 | 1 | 1 | | output? | | | | | #include<stdio.h><br>#include<math.h><br>void fun(int a)<br>{<br>static int b= 5;<br>int c= 10;<br>printf("%d\n", a + b + c);<br>}<br>int main()<br>{<br>float x= 2.3;<br>fun(4);<br>fun(sqrt(49));<br>fun(2+3);<br>fun(x);<br>return 0;<br>} | 2 | 1 | 1 | | Output? | | | | | int a= 10; | 2 | 1 | 1 | | int main()<br>{<br>int a= 5;<br>{<br>int a= 23;<br>printf("%d\n", a+a+a);<br>}<br>return 0;<br>} | | | | | output? | | | | | #include<stdio.h><br>void swap(int a, int b)<br>{<br>a= a^b;<br>b= a^b;<br>a= a^b;<br>}<br>int main()<br>{<br>int a= 10, b= 20;<br>printf("a= %d\tb= %d\n", a, b);<br>swap(b, a);<br>printf("a= %d\tb= %d\n", a, b);<br>return 0;<br>} | 2 | 1 | 1 | | Output? | | | | | int a[]={1, 2, 3};<br>int b[5]={1, 2, 3};<br>int c[5]= { 1, 2, 3, 4, 5, 76};<br>int d[]={ 'A', 'B', 'C'};<br>int e[][]={{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};<br>int f[][]= {1, 2, 3, 4, 5, 6, 7, 8, 9};<br>int g[][]={{1, 2}, {4, 5, 6}, {7}};<br>int h[][3]={{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};<br>int i[3][3]={{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};<br>int g[3][3]={{1, 2}, {4, 5, 6}, {7}};<br>int g[][3]={{1, 2}, {4, 5, 6}, {7}}; | 2 | 1 | 1 | | Identify the correct and incorrect array initialization statements. | | | | | int a[]={1, 2, 3, 4, 5};<br>printf("%d\n", a[a[a[a[0]]]+1]);<br>printf("%d\n", a[a[4]-a[a[0]+a[1]]]);<br>printf("%d\n", a[a[a[a[a[0]]]+1] - a[a[4]-a[a[0]+a[1]]]]* a[a[4]/2]);<br>printf("%d\n", a['A' - 'B' + 2]); | 2 | 1 | 1 | | WACP Copy content of a 2D array into a 1D array. | 2 | 1 | 1 | | What are the care to be taken for successful execution of a recursive call? Describe with example. | 2 | 1 | 1 | | What is a multi-dimensional array? Describe briefly. | 2 | 1 | 1 | | What are array subscript/index values and its purpose w.r.t. different types of arrays? | 2 | 1 | 1 | | What are the 3 steps to be followed to design user defined function successfully? briefly describe. | 2 | 1 | 1 | | is main() function a user defined function? justify your answer. | 2 | 1 | 1 | | Define a UDF that takes 0 or 1 as input and returns opposite bit. (Note: don't use conditional operator or conditional statements) | 2 | 1 | 1 | | Define a UDF to print array content in reverse order. | 2 | 1 | 1 | | printf("%ld\n", sizeof("Hello World"));<br>printf("%d\n", printf("Hello"));<br>printf("%d\n", printf("%d%d", 43454, 5));<br>printf("%d\n", 'A' - 'a' - -32);<br>output? | 2 | 1 | 1 | | How to calculate array size in bytes. Can we change array size after the array is declared. | 2 | 1 | 1 | | Define a UDF that takes 2 numbers as input and gives back the results of all 4 arithmetic operations. | 2 | 1 | 1 | | char a[]={'a', 'b', 'c', 'd'};<br>char b[]="abcd";<br>Differentiate the arrays a and b. | 2 | 1 | 1 | | Define a UDF that takes a string as input and returns length of the string. (Don't use any predefined function). | 2 | 1 | 1 | | Discuss any 4 functions from string.h header file. | 2 | 1 | 1 | | Discuss strlen(), strcpy(), strcat() and strcmp () functions. | 2 | 1 | 1 | | char s1[5]="GIFT", s2[]="ODISHA", s3[]= "BBSR";<br>strcat(s1, s3);<br>strcat(s1, s2);<br>printf("%s", s1); | 2 | 1 | 1 | | Input first name, middle name and last name form the full name. | 2 | 1 | 1 | | Differentiate printf("%s", ....) and puts() functions. | 2 | 1 | 1 | | Differentiate scanf("%s", ....) and gets() functions. | 2 | 1 | 1 | | Define a UDF to change a string to uppercase. | 2 | 1 | 1 | | Define a UDF to change a string to lowercase. | 2 | 1 | 1 | | Define a UDF to confirm that a string contains any special character or not. | 2 | 1 | 1 | | What it the most efficient way to work with all the elements of an array? Describe. | 2 | 1 | 1 | | Define a UDF to replace only alphabets with its next alphabet within a string. | 2 | 1 | 1 | | Define a UDF to count vowels in a string (Use switch...case only). | 2 | 1 | 1 | | Design a UDF to display a string as follows: <br>input: RAM<br>output:<br>R<br>RA<br>RAM | 2 | 1 | 1 | ## Section B | | Questions | BTL | |:---|:---|:---| | 1 | Write a C program to reverse an array content within the same array. | 2 | | 2 | Write a C program to merge two arrays of different sizes. | 2 | | 3 | Differentiate user defined functions and pre-defined functions. | 2 | | 4 | Discuss call by value and call by reference. | 2 | | 5 | Differentiate call by value and call bt reference. | 2 | | 6 | Discuss array as function parameter. | 2 | | 7 | Design a user defined function to find array sum. | 2 | | 8 | Differentiate Global and local storage variables. | 2 | | 9 | Compare and contrast loops and recursion? | 2 | | 10 | WACP to design a recursive function to find first n terms of fobinacci series. | 2 | | 11 | Discuss array as function parameter with example. | 2 | | 12 | Discuss working with characters in C.. | 2 | | 13 | WACP to find transpose of a matrix within the same matrix. | 2 | | 14 | Give examples: array indices as literals, identifiers. expressions, another array element (int type) and function calls and discuss. | 2 | | 15 | WACP to implement linear search. | 2 | | 16 | WACP to implement binary search. | 2 | | 17 | WACP to sort an array. | 2 | | 18 | WACP to perform matrix addition. | 2 | | 19 | WACP to copy array content to another array in reverse order. | 2 | | 20 | Discuss with example the different forms parameters to a function. | 2 | | 21 | WACP to find binary equivalent of a positive integer. | 2 | | 22 | WACP to input different subjects marks of students in a class and display their result. | 2 | | 23 | WACP to count the occurrences of highest value in the array. | 2 | | 24 | WACP to right rotate array contents. | 2 | | 25 | WACP to find the array values which are larger than average value of the array. | 2 | | 26 | WACP to find the array values which are smaller than average value of the array. | 2 | | 27 | WACP to find the count of positive numbers, negative numbers and zeros in an array. | 2 | | 28 | WACP to swap consecutive elements of an array. | 2 | | 29 | WACP to left rotate array content. | 2 | | 30 | WACP to swap any two rows of a 2D array. | 2 | | 31 | WACP to count each alphabet occurrences in a string. | 2 | | 32 | WACP to spell each digit of a number. | 2 | | 33 | WACP to add elements of outer ring of a 2D array. | 2 | | 34 | WACP to count number of words, characters in an entered sentence. | 2 | | 35 | WACP to perform matrix subtraction. | 2 | ## Section C | | Questions | BTL | |:---|:---|:---| | 1 | Write a C program for matrix multiplication. | 2 or 3 | | 2 | Write a menu based C program for addition and/or subtraction. | 3 | | 3 | Write C program for find ing all row sums, column sums and diagonal sums of a square matrix. | 3 | | 4 | Discuss storage classes in detail with examples. | 3 | | 5 | Discuss all the 4 types of functions based on parameter passing and return type. | 3 | | 6 | Design Tower of Hanoi program.| 3 | | 7 | Design matrix multiplication program. | 3 | | 8 | WACP to input a sentence and list out the alphabates used in the sentence. | 3 | | 9 | Give examples: function parameters as literals, identifiers. expressions and function calls and discuss. | 3 | | 10 | WACP to implement binary search using recursion and sorting using a function. | 3 | | 11 | WACP to perform matrix multiplication with proper validation. | 3 | | 12 | WACP to find row individual row sums, individual column sums and both the diagonal sums of a square matrix. | 4,5,6 | ## Section D | | Questions | CO | BTL | |:---|:---|:---|:---| | 1 | How to work with User Defined Functions? Discuss in detail with sufficient examples with all special cases. | 1 | 4 | | 2 | What is an array? What are different types of arrays? Discuss how to work with all the types of arrays. | 1 | 4 | | 3 | Write a C program to design a menu based matrix arithmetic operations by designing functions for each arithmetic operation over matrices. | 1 | 4 | | 4 | Discuss any 10 predefined functions from string.h header file. | 1 | 4 | | 5 | Write a C program to find section wise topper and college topper of group of students. Each student appears 5 subjects. | 1 | 4 | ** BTL: Bloom's Taxonomy Level ** CO: Course Outcomes BTL are: 1. Remembering 2. Understanding, 3. Applying, 4. Analysing, 5. Evaluating 6. Creating

Use Quizgecko on...
Browser
Browser