Skip to main content

Model Question Paper EST 102 Programming in C

 APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY FIRST SEMESTER B.TECH DEGREE EXAMINATION, MONTH & YEAR

Course Code: EST 102

Course Name: Programming in C (Common to all programs)

Max.Marks:100 Duration: 3 Hours

PART A

Answer all Questions. Each question carries 3 Marks  (10x3=30)

1. Write short note on processor and memory in a computer.
2. What are the differences between compiled and interpreted languages? Give example for each.
3. Write a C program to read a Natural Number through keyboard and to display the reverse of the given number. For example, if “3214567” is given as input, the output to be shown is “7654123”.
4. Is it advisable to use goto statements in a C program? Justify your answer.
5. Explain the different ways in which you can declare & initialize a single dimensional array.
6. Write a C program to read a sentence through keyboard and to display the count of white spaces in the given sentence.
7. What are the advantages of using functions in a program?
8. With a simple example program, explain scope and life time of variables in C.
9. Write a function in C which takes the address of a single dimensional array (containing a finite sequence of numbers) and the number of numbers stored in the array as arguments and stores the numbers in the same array in reverse order. Use pointers to access the elements of the array.
10. With an example, explain the different modes of opening a file.               

Part B

Answer any one Question from each module. Each question carries 14 Marks (14X5=70)

11. 
(a) Draw a flow chart to find the position of an element in a given sequence, using linear searching technique. With an example explain how the flowchart finds the position of a given element. (10)
(b) Write a pseudo code representing the flowchart for linear searching. (4)
OR
12.
(a) With the help of a flow chart, explain the bubble sort operation. Illustrate with an example. (10)
(b) Write an algorithm representing the flowchart for bubble sort. (4)

13.
(a) Write a C program to read an English Alphabet through keyboard and display whether the given Alphabet is in upper case or lower case. (6)
(b) Explain how one can use the builtin function in C, scanf to read values of different data types. Also explain using examples how one can use the builtin function in C, printf for text formatting. (8)
OR
14. (a) With suitable examples, explain various operators in C. (10)
(b) Explain how characters are stored and processed in C. (4)


15. (a) Write a function in C which takes a 2-Dimensional array storing a matrix of numbers and  the order of the matrix (number of rows and columns) as arguments and displays the sum of the elements stored in each row. (6 )
(b) Write a C program to check whether a given matrix is a diagonal matrix. (8)

OR

16. (a) Without using any builtin string processing function like strlen, strcat etc., write a program to concatenate two strings. (8)
(b) Write a C program to perform bubble sort. (6)


17. (a) Write a function namely myFact in C to find the factorial of a given number. Also, write another function in C namelynCr which accepts two positive integer parameters n and r and returns the value of the mathematical functionC(n,r)( n! / ( r! x (n - r)!) ). The function nCr is expected to make use of the factorial function myFact. (10)
(b) What is recursion? Give an example. (4)

OR

18. (a) With a suitable example, explain the differences between a structure and a union in C.  (6)
(b) Declare a structure namely Student to store the details (roll number, name, mark_for_C) of a student. Then, write a program in C to find the average mark obtained by the students in a class for the subject Programming in C (using the field mark_for_C). Use array of structures to store the required data (8)

19. (a) With a suitable example, explain the concept of pass by reference. (6)
(b) With a suitable example, explain how pointers can help in changing the content of a single dimensionally array passed as an argument to a function in C. (8)

OR

20. (a) Differentiate between sequential files and random access files? (4)
(b) Using the prototypes explain the functionality provided by the following functions. (10)

i. fseek()
ii. ftell()
iii. fread()
iv. fwrite()
v.rewind         

Comments

Popular posts from this blog

KTU Mandatory C programs for Laboratory and Solutions

LIST OF LAB EXPERIMENTS 1. Familiarization of Hardware Components of a Computer 2. Familiarization of Linux environment – Programming in C with Linux 3. Familiarization of console I/O and operators in C     i) Display “Hello World”     ii) Read two numbers, add them and display their sum     iii) Read the radius of a circle, calculate its area and display it 4. Evaluate the arithmetic expression ((a -b / c * d + e) * (f +g))   and display its solution. Read the values of the variables from the user through console 5. Read 3 integer values, find the largest among them. 6. Read a Natural Number and check whether the number is prime or not 7. Read a Natural Number and check whether the number is Armstrong or not 8. Read n integers, store them in an array and find their sum and average 9. Read n integers, store them in an array and search for an element in the    array using an algorithm for Linear Search 10.Read n integers, store them in an array and sort the elements in t

PROGRAMMING IN C KTU EST 102 THEORY AND LAB NOTES

PROGRAMMING IN C  KTU  EST 102  THEORY AND LAB   COMMON FOR ALL BRANCHES About Me Syllabus Theory Syllabus Lab Model Question Paper EST 102 Programmin in C University Question Papers  and evaluation scheme   EST 102 Programming in C  Introduction( Lab) Introduction to C programming Linux History and GNU How to create a bootable ubuntu USB stick Installing  Linux Install Linux within  Windows Virtual Box and WSL Linux Basic Features and Architecture Basic Linux Commands Beginning C Programming Compiling C programs using gcc in Linux Debugging C program using gdb Module 1: Basics of computer hardware and software          Module-1 Reading Material Basics of Computer Architecture Hardware and Software System Software and Application Software  Programming Languages ( High level, Low level and Machine Language) and Translators ( Compiler, Interpreter, Assembler) Algorithm, Flowcharts and Pseudo code Program Development Structured Programming Basics of hardware ( video) Know about Motherboar