University of Madras
Chepauk, Chennai-600 005.
University of Madras
Chepauk, Chennai - 600 005.
Programming in C
Chepauk, Chennai - 600 005.
Programming in C
Month & Year of Examination: November 2011
Subject Code: PK2B
Semester: II
Year: First Year
Time: Three hours
Maximum: 100 Marks
Subject Code: PK2B
Semester: II
Year: First Year
Time: Three hours
Maximum: 100 Marks
Part - A (10 * 3 = 30 Marks)
Answer any TEN questions
All questions carry equal marks
Each answer should not exceed 50 words
Answer any TEN questions
All questions carry equal marks
Each answer should not exceed 50 words
1. What are relational expressions?
2. Write a note on: Conditional operator.
3. Write the general syntax of ‘do-while’ structure with an example.
4. Write the purpose of ‘break’ statement.
5. Write a note on: getch() function.
6. What are functions?
7. Define: External variables. Give an example.
8. What are Arrays?
9. Define: Unions
10. How to declare pointers in C? Give an example.
11. What are files?
12. How to class a file in C?
2. Write a note on: Conditional operator.
3. Write the general syntax of ‘do-while’ structure with an example.
4. Write the purpose of ‘break’ statement.
5. Write a note on: getch() function.
6. What are functions?
7. Define: External variables. Give an example.
8. What are Arrays?
9. Define: Unions
10. How to declare pointers in C? Give an example.
11. What are files?
12. How to class a file in C?
Part - B (5 * 6 = 30 Marks)
Answer any FIVE questions
All questions carry equal marks
Each answer should not exceed 200 words
Answer any FIVE questions
All questions carry equal marks
Each answer should not exceed 200 words
13. Discuss about different types of constants in C with examples.
14. Explain any three commonly used library functions with examples.
15. Write a C program to find the smallest number among three given numbers.
16. What are nested control structures? Explain with examples.
17. Discuss about static and register variables with examples.
18. Write about bit-wise operations with suitable examples.
19. Discuss about arrays of pointers with examples.
14. Explain any three commonly used library functions with examples.
15. Write a C program to find the smallest number among three given numbers.
16. What are nested control structures? Explain with examples.
17. Discuss about static and register variables with examples.
18. Write about bit-wise operations with suitable examples.
19. Discuss about arrays of pointers with examples.
Part - C (4 * 10 = 40 Marks)
Answer any FOUR questions
All questions carry equal marks
Each answer should not exceed 500 words
Answer any FOUR questions
All questions carry equal marks
Each answer should not exceed 500 words
20. Explain about various types of operators with examples.
21. Write a C program to find the sum of the series 13+33+53+……. +N3
22. Explain about function prototypes and passing arguments in C with examples.
23. Write a C program to find the maximum value among N given numbers.
24. Discuss about file creation and processing with an example C program.
25. Explain the following with examples:
(a) Self-referential structures.
(b) Operations in pointers.
21. Write a C program to find the sum of the series 13+33+53+……. +N3
22. Explain about function prototypes and passing arguments in C with examples.
23. Write a C program to find the maximum value among N given numbers.
24. Discuss about file creation and processing with an example C program.
25. Explain the following with examples:
(a) Self-referential structures.
(b) Operations in pointers.
Subject Name: Programming in C
Month & Year of Examination: April 2010
Subject Code: PK2B
Semester: II
Year: First Year
Time: Three hours
Maximum: 100 Marks
Month & Year of Examination: April 2010
Subject Code: PK2B
Semester: II
Year: First Year
Time: Three hours
Maximum: 100 Marks
Section A (10 * 2 = 20)
Answer any TEN questions.
All questions carry equal marks.
Each answer should not exceed 30 words.
Answer any TEN questions.
All questions carry equal marks.
Each answer should not exceed 30 words.
1) what are constants?
2) what are relational operators in c?
3) what is the purpose of conditional operator?
4) what is the use of '\n'?
5) define: recursion.
6) what is the static variable? when should it be used?
7) what is meant by prototyping?
8) what is an array variable? how does it differ from an ordinary variable?
9) what are self-referential structures?
10) mention the features of 'union' data type.
11) write the advantages of pointers.
12) what is the use of append mode in file handling?
2) what are relational operators in c?
3) what is the purpose of conditional operator?
4) what is the use of '\n'?
5) define: recursion.
6) what is the static variable? when should it be used?
7) what is meant by prototyping?
8) what is an array variable? how does it differ from an ordinary variable?
9) what are self-referential structures?
10) mention the features of 'union' data type.
11) write the advantages of pointers.
12) what is the use of append mode in file handling?
Section B (5 * 5 = 25)
Answer any FIVE questions.
All questions carry equal marks.
Each answer should not exceed 200 words.
Answer any FIVE questions.
All questions carry equal marks.
Each answer should not exceed 200 words.
13) write short notes on : declarations and expressions in c.
14) explain any four library functions with examples.
15) write a c program to find the sum of odd integers between 1 and n.
16) compare 'while' and 'do-while' statements.
17) write a c program to find the biggest of given n numbers.
18) explain about the logical bit-wise operators with examples.
19) discuss briefly about pointer declarations with examples.
14) explain any four library functions with examples.
15) write a c program to find the sum of odd integers between 1 and n.
16) compare 'while' and 'do-while' statements.
17) write a c program to find the biggest of given n numbers.
18) explain about the logical bit-wise operators with examples.
19) discuss briefly about pointer declarations with examples.
Section C (3 * 10 = 30)
Answer any THREE questions.
All questions carry equal marks.
Each answer should not exceed 500 words.
Answer any THREE questions.
All questions carry equal marks.
Each answer should not exceed 500 words.
20) Write a c program to evaluate the series: s = 1 + 1/2 + 1/3 + ... + 1/n.
21) Explain about various data input and output functions in c with suitable examples.
22) Write a c program which calls a function reverse() which accepts a string and displays its reverse.
23) Explain about passing arrays to functions with an example c program.
24) Describe in detail, file handling functions in c with examples.
21) Explain about various data input and output functions in c with suitable examples.
22) Write a c program which calls a function reverse() which accepts a string and displays its reverse.
23) Explain about passing arrays to functions with an example c program.
24) Describe in detail, file handling functions in c with examples.
Subject Name: Programming in C
Month & Year of Examination: April 2009
Subject Code: PK2B
Semester: II
Year: First Year
Time: Three hours
Maximum: 100 Marks
Month & Year of Examination: April 2009
Subject Code: PK2B
Semester: II
Year: First Year
Time: Three hours
Maximum: 100 Marks
Part - A (10 * 3 = 30 Marks)
Answer any TEN questions
All questions carry equal marks
Each answer should not exceed 50 words
Answer any TEN questions
All questions carry equal marks
Each answer should not exceed 50 words
1. What are the data types in C?
2. List the Arithmetic operators in C.
3. Give the general form of 'while' statement with an example.
4. What is the use of 'continue' statement? Give an example.
5. What are functions?
6. Define: Recursion.
7. What are External Variables?
8. Define: Array.
9. What are structures?
10. Write a note on: The one's complement operator.
11. What are pointers?
12. What are stream-oriented data files?
2. List the Arithmetic operators in C.
3. Give the general form of 'while' statement with an example.
4. What is the use of 'continue' statement? Give an example.
5. What are functions?
6. Define: Recursion.
7. What are External Variables?
8. Define: Array.
9. What are structures?
10. Write a note on: The one's complement operator.
11. What are pointers?
12. What are stream-oriented data files?
Part - B (5 * 6 = 30 Marks)
Answer any FIVE questions
All questions carry equal marks
Each answer should not exceed 200 words
Answer any FIVE questions
All questions carry equal marks
Each answer should not exceed 200 words
13. Write a C program to calculate area of a circle.
14. Discuss about Relational and Logical Operators in C with examples.
15. Explain the general syntax of 'for' statement with an example.
16. Write a C program to convert a line of lower-case text to upper-case.
17. Write about Automatic and Static Variables.
18. What are self-referential structures? Give an example.
19. Write the general syntax of fopen() functions with example
14. Discuss about Relational and Logical Operators in C with examples.
15. Explain the general syntax of 'for' statement with an example.
16. Write a C program to convert a line of lower-case text to upper-case.
17. Write about Automatic and Static Variables.
18. What are self-referential structures? Give an example.
19. Write the general syntax of fopen() functions with example
Part - C (4 * 10 = 40 Marks)
Answer any FOUR questions
All questions carry equal marks
Each answer should not exceed 500 words
Answer any FOUR questions
All questions carry equal marks
Each answer should not exceed 500 words
20. Explain about any FIVE library functions in C with suitable examples.
21. Explain about various Data Input and Output Functions with examples.
22. Write a C program to calculate the average of N given numbers.
23. Write a C program to find the largest of three integer quantities using function.
24. Write a C program to arrange the given numbers in Ascending order.
25. Explain bout operations on pointers with suitable example
21. Explain about various Data Input and Output Functions with examples.
22. Write a C program to calculate the average of N given numbers.
23. Write a C program to find the largest of three integer quantities using function.
24. Write a C program to arrange the given numbers in Ascending order.
25. Explain bout operations on pointers with suitable example
Month & Year of Examination: November - 2009
Subject Code: PK2B
Semester: II
Year: First Year
Time: Three hours
Maximum: 100 Marks
Subject Code: PK2B
Semester: II
Year: First Year
Time: Three hours
Maximum: 100 Marks
Part - A (10 * 3 = 30 Marks)
Answer any TEN questions
All questions carry equal marks
Each answer should not exceed 50 words
Answer any TEN questions
All questions carry equal marks
Each answer should not exceed 50 words
1. Write a note on character constants in C.
2. Write about Assignment Operator in C.
3. What is the use of getchar() function? Give an example.
4. Write the use of 'break' statement with an example.
5. What are function prototypes?
6. What are Register Variables?
7. Define Multifile programs.
8. Give the general syntax for an one-dimensional array definition with an example?
9. What are Multidimensional Arrays?
10.Define: Union.
11.What is the purpose of the indirection operator? Give an example.
12.Write a note on: fclose() function.
2. Write about Assignment Operator in C.
3. What is the use of getchar() function? Give an example.
4. Write the use of 'break' statement with an example.
5. What are function prototypes?
6. What are Register Variables?
7. Define Multifile programs.
8. Give the general syntax for an one-dimensional array definition with an example?
9. What are Multidimensional Arrays?
10.Define: Union.
11.What is the purpose of the indirection operator? Give an example.
12.Write a note on: fclose() function.
Part - B (5 * 6 = 30 Marks)
Answer any FIVE questions
All questions carry equal marks
Each answer should not exceed 200 words
Answer any FIVE questions
All questions carry equal marks
Each answer should not exceed 200 words
13. Explain about integer and string constants with examples.
14. Write a C program to find the sum of N given numbers.
15. Distinguish between 'while' and 'do-while' statements.
16. Explain about any FOUR commonly used conversion characters for Data Input with examples.
17. Write a C function to find the factorial value of n.
18.What are user defined data types? Explain with example.
19. Write a C program to create a Data File.
14. Write a C program to find the sum of N given numbers.
15. Distinguish between 'while' and 'do-while' statements.
16. Explain about any FOUR commonly used conversion characters for Data Input with examples.
17. Write a C function to find the factorial value of n.
18.What are user defined data types? Explain with example.
19. Write a C program to create a Data File.
Part - C (4 * 10 = 40 Marks)
Answer any FOUR questions
All questions carry equal marks
Each answer should not exceed 500 words
Answer any FOUR questions
All questions carry equal marks
Each answer should not exceed 500 words
20. (a) Explain briefly about declaration and expressions in with examples.
(b) Write a C program to find the smallest number among three given numbers.
21. Write a C program to find all possible roots of a Quadratic Equation Ax2 + Bx + C = 0
22. Explain the following with suitable examples:
(a) Nested Loops (b) The switch statement.
23. Write a C program to add and substract two given matrices.
24.Write a C program to arrange the given strings in Alphabetical Order.
25. Explain about Arrays of Pointers with an example C program.
(b) Write a C program to find the smallest number among three given numbers.
21. Write a C program to find all possible roots of a Quadratic Equation Ax2 + Bx + C = 0
22. Explain the following with suitable examples:
(a) Nested Loops (b) The switch statement.
23. Write a C program to add and substract two given matrices.
24.Write a C program to arrange the given strings in Alphabetical Order.
25. Explain about Arrays of Pointers with an example C program.
Month & Year of Examination: April 2008
Subject Code: PK2B
Semester: II
Year: First Year
Time: Three hours
Maximum: 100 Marks
Subject Code: PK2B
Semester: II
Year: First Year
Time: Three hours
Maximum: 100 Marks
Part - A (10 * 3 = 30 Marks)
Answer any TEN questions
All questions carry equal marks
Each answer should not exceed 50 words
Answer any TEN questions
All questions carry equal marks
Each answer should not exceed 50 words
1.Differentiate between identifiers and keywords.
2.Write a note on unary operators in c.
3.What do you mean by nested control structures? State the rules.
4.Differentiate between break and continue statements.
5.Write a note on comma operators.
6.Define prototype.
7.Write a note on multifile programs.
8.What do you mean by recursion?
Write a recursive program to find factorial of a number.
9.What are user defined data types?
10.Differentiate between structure and union.
11.Define the meaning of * a[10] and (*a)[10].
12.How will you test the end of file?
2.Write a note on unary operators in c.
3.What do you mean by nested control structures? State the rules.
4.Differentiate between break and continue statements.
5.Write a note on comma operators.
6.Define prototype.
7.Write a note on multifile programs.
8.What do you mean by recursion?
Write a recursive program to find factorial of a number.
9.What are user defined data types?
10.Differentiate between structure and union.
11.Define the meaning of * a[10] and (*a)[10].
12.How will you test the end of file?
Part - B (5 * 6 = 30 Marks)
Answer any FIVE questions
All questions carry equal marks
Each answer should not exceed 200 words
Answer any FIVE questions
All questions carry equal marks
Each answer should not exceed 200 words
13. Develop a C program to find the smallest and second smallest from a set of numbers.
14. Write the difference between while and for statement.
15. Write a program in C to multiply two matrixes A and B the resultant matrix in C the memory.
16. Write a function using pointers to exchange the values stored in two locations
17. Write a program to read a line of text containing a series of words from the terminal.
18. Discuss the uses and limitations of a function getc and putc.
Distinguish the following concepts:
getch and getchar printf and fprintf feof and ferror.
19. Write a C program to read 100 numbers into an array and compute the mean of the seven numbers.
14. Write the difference between while and for statement.
15. Write a program in C to multiply two matrixes A and B the resultant matrix in C the memory.
16. Write a function using pointers to exchange the values stored in two locations
17. Write a program to read a line of text containing a series of words from the terminal.
18. Discuss the uses and limitations of a function getc and putc.
Distinguish the following concepts:
getch and getchar printf and fprintf feof and ferror.
19. Write a C program to read 100 numbers into an array and compute the mean of the seven numbers.
Part - C (4 * 10 = 40 Marks)
Answer any FOUR questions
All questions carry equal marks
Each answer should not exceed 500 words
Answer any FOUR questions
All questions carry equal marks
Each answer should not exceed 500 words
20.(a)Explain the relational, logical and assignment operators.
(b)Explain any four mathematical library functions in c.
21.There are n students in a co-education class. For each student the sex code (1 for male and 2 for female) and height are available. Write a program to find the average male height and the average female height.
22.Discuss the storage classes.
23.Write a program to evaluate ncr using a recursive function to find n!, where
ncr = n!
--------------
r!(n!-r!)!
24.Write a program to multiply two matrices of order m x n and n x l.
25.Write a program to create a sequential data file called NUMBER.DAT with a set of integer numbers. Write another program to read numbers from the created file and create two files namely ODD.DAT and EVEN.DAT with odd and even numbers respectively
(b)Explain any four mathematical library functions in c.
21.There are n students in a co-education class. For each student the sex code (1 for male and 2 for female) and height are available. Write a program to find the average male height and the average female height.
22.Discuss the storage classes.
23.Write a program to evaluate ncr using a recursive function to find n!, where
ncr = n!
--------------
r!(n!-r!)!
24.Write a program to multiply two matrices of order m x n and n x l.
25.Write a program to create a sequential data file called NUMBER.DAT with a set of integer numbers. Write another program to read numbers from the created file and create two files namely ODD.DAT and EVEN.DAT with odd and even numbers respectively
Month & Year of Examination: 2006
Subject Code: PK2B
Semester: IV
Year: Third Year
Time: Three hours
Maximum: 100 Marks
Subject Code: PK2B
Semester: IV
Year: Third Year
Time: Three hours
Maximum: 100 Marks
SECTION A (15 X 2 = 30)
Answer ALL the questions.
All questions carry equal marks
Each answer should not exceed 50 words
Answer ALL the questions.
All questions carry equal marks
Each answer should not exceed 50 words
1. List down the differences between Break and Continue st.
2. List down the different operators available in C.
3. Define register variable.
4. What do you mean by preprocessor?
5. What is the meaning of '&' operator? Along with which variable it may be used?
6. What is meant by multidimensional array?
7. Explain the term void function.
8. Give the syntax of union.
9. Explain any two standard mathematical functions.
10.List down the different I/O operations on files.
11 What is stack?
12.How can labeled data items be generated by the printf() function?
2. List down the different operators available in C.
3. Define register variable.
4. What do you mean by preprocessor?
5. What is the meaning of '&' operator? Along with which variable it may be used?
6. What is meant by multidimensional array?
7. Explain the term void function.
8. Give the syntax of union.
9. Explain any two standard mathematical functions.
10.List down the different I/O operations on files.
11 What is stack?
12.How can labeled data items be generated by the printf() function?
SECTION B (6 X 5 = 30)
ANSWER ANY SIX QUESTIONS
All questions carry equal marks
Each answer should not exceed 200 words
ANSWER ANY SIX QUESTIONS
All questions carry equal marks
Each answer should not exceed 200 words
13.Develop a C program to find the smallest and second smallest from a set of numbers.
14.Write the difference between while and for statement.
15.Write a program in C to multiply two matrixes A and B the resultant matrix in C.
16.Write a function using pointers to exchange the values stored in two locations in the memory.
17.Write a program to read a line of text containing a series of words from the terminal.
18.Discuss the uses and limitations of a function getc and putc. Distinguish the following concepts: getch and
getchar printf and fprintf feof and ferror.
19.Write a C program to read 100 numbers into an array and
compute the mean of only the seven numbers.
14.Write the difference between while and for statement.
15.Write a program in C to multiply two matrixes A and B the resultant matrix in C.
16.Write a function using pointers to exchange the values stored in two locations in the memory.
17.Write a program to read a line of text containing a series of words from the terminal.
18.Discuss the uses and limitations of a function getc and putc. Distinguish the following concepts: getch and
getchar printf and fprintf feof and ferror.
19.Write a C program to read 100 numbers into an array and
compute the mean of only the seven numbers.
SECTION C (4 X 10 = 40)
ANSWER ANY FOUR QUESTIONS
All questions carry equal marks
Each answer should not exceed 500 words
ANSWER ANY FOUR QUESTIONS
All questions carry equal marks
Each answer should not exceed 500 words
20. Write the different types of IF structure available in C.
21. Summarize several types of commonly used linked data structures. Write a C program to create and maintain a
singly linked list.
22. Write a C program to compute the real and complex roots of a quadratic equation ax2 + bx + c = 0.
23. An n -order polynomial can be evaluated as follows: P = (...(aoX + at)X + az)X + ...an)
Write a function to evaluate the polynomial using an array variable n .
24. Using pointers, write a function that receives a character string and a character as argument and delete
all occurrences of this character in the string. This function should return the corrected string with holes.
25. What is meant by Nested structure and Array of structure? Explain it with example.
21. Summarize several types of commonly used linked data structures. Write a C program to create and maintain a
singly linked list.
22. Write a C program to compute the real and complex roots of a quadratic equation ax2 + bx + c = 0.
23. An n -order polynomial can be evaluated as follows: P = (...(aoX + at)X + az)X + ...an)
Write a function to evaluate the polynomial using an array variable n .
24. Using pointers, write a function that receives a character string and a character as argument and delete
all occurrences of this character in the string. This function should return the corrected string with holes.
25. What is meant by Nested structure and Array of structure? Explain it with example.