Download as pdf
Download as pdf
You are on page 1of 4
(@2)) 1 Sem B.Tech Prog. in € CS1001 (All Branches) — AUTUMN END SEMESTER EXAMINATION-2019 1 Semester B.Tech PROGRAMMING IN C Cs1001 (For 2017 Admitted Batch) Time: 3 Hours Full Marks: 50 Answer any SIX questions. Question paper consists of four sections-A, B, C, D. Section A is compulsory. Attempt minimum one question each from Sections B, C, D. The figures in the margin indicate full marks. Candidates are required to give their answers in their own words as far as practicable and all parts of a question should be answered at one pl nly. SECTION-A 1. Answer the following questions. [1 x 10] (a) What is the difference between entry-controlled and exit-controlled loops in C? (b) What will be the output of the following code segments? #include int main( ){ int A[ }= {0,1,2,3,4},i; Ds) (c) #define flag 0 #include int main( ){ char af J={'K', T','', 'T, \0'",' if (flag) printf ("Hello %s", a+1); else printf ("World %s", a+5); } KIE-DU 2019 SOT Autumn find Semester Esammenon-2019— (V) (d) (e) () (g) (h) @ @ Which operator has the — lowest __ priority? a)% b)&& c)- d)|l What is the difference between structure and union in ee What will be the output of the following C program? Justify your answer. #include int main () t int i=0, x=0; for (i=1 ; i<10; i *=2) { seb. printf ("%d", x); dif (‘\n x=%d", x); return 0; } What is conditional operator? Explain its concept with a suitable example. Write the output of following code : #include int main(){ inte=2%3; printf(" %d\n" , c); return 0; } Write the output of following code : #define f(n) n*n #include int main () { int a=5, b= 10; printf("%d",f(a+b) ); } Briefly discuss about any two storage classes in C. KIFT-DU 2019 SOT Autumn End Semester Exammanion-2019 (2) (b) we (a) (b) (b) (b) SECTION-B State the different user defined data-types in C. Explain their declaration and initialization with suitable examples. Write a C program to find whether a given number is Palindrome number or not. (e.g. 121 is a palindrome number because the reverse of 121 is121 itself). Write a C program to print the following pattern: 1 12 123 1234 12345 Write a C program to print the total and average of three subjects and also find out (print) their grade based on the obtained average using Switch-Case statement. SECTION-C Write a C program to multiply two matrices Arixet and Broxe2, Where rl, cl and r2, c2 are the rows and columns of the given matrices A and B respectively (using 2D integer arrays). What is recursion? Write a recursive C program to print n'" term of the Fibonacci series. (value of n is to be given by user) Write a C program to merge two different integer arrays into a new array and print the new array. Write a C program to find out the occurrence of each character element in the given character array using user defined function. (e.g., K=1, i=2 and T=1 in the array “KiiT”). KIFP-DU 2019 SOT Autumn find Semester Exammanon-2019 (3) [4] [4] 4] [4] [4] [4] [4] [4] (b) (b) (a) (b) (c) Write a C program to find out the k" largest element of a given integer array.(value of k is to be given by user) Explain Call by value and call by address methods using suitable examples. SECTION-D Write a C program to sort a given integer array in decreasing order. Write a C program to store employee name, employee id, designation and salary. Also, write another C program to read the file content and print it on monitor. Write short notes on any two: Break and Continue malloc and calloc Binary Search sok KIIT-DU 2019 SOT Autumn End Semester Eaminanion-2019 (AY [4] [4] [4] [4] [4x2]

You might also like