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

Programming in C - B2

This document outlines the Second Class Test for the B. TECH Degree in Programming in C, including various programming tasks and questions. It consists of two parts: Part A requires answering all questions, while Part B allows selection of one question from each module. The test assesses skills in functions, recursion, data structures, and file handling in C programming.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Programming in C - B2

This document outlines the Second Class Test for the B. TECH Degree in Programming in C, including various programming tasks and questions. It consists of two parts: Part A requires answering all questions, while Part B allows selection of one question from each module. The test assesses skills in functions, recursion, data structures, and file handling in C programming.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

COLLEGE OF ENGINEERING TRIVANDRUM


Second Semester B. TECH Degree B2
Second Class Test April 2025
GXEST204 PROGRAMMING IN C

Max, Marks: 40 Duration: 1.5 Hours


Part A Mark CO K
(Answer AllQuestions) level
[3] CO3 K3
1 Write a function which accepts a counting number as argument and
returns the largest digit of the counting number.
3] CO3 K3
2.
Write a recursive function for finding x ,where x is an integer and n is a non
negative integer value.
[3] CO4 K3
3. Write the meaning of the followong declarations:
(a) char *p[51;
(b) int *(*a)( );
(c) char * p(int (*a)());
COS K3
4 Write a Cprogram for implementing the cat command in UNIX. The cat [3]
command is used for displaying the content of a text file.
Part B
(Answer any one fullquestion from each module.)
(Each question carries 14 marks)
Module III
[7] CO3 K3
5.a Wrte a function for checking whether a counting number is armstrong
number or not. Using this function write a program for displaying the
armstrong numbers in a mxn matrix.
[7] CO3 K3
5.b Write a function for checking whether a string is palindrome or not.
Write a program which accepts a N strings and display the palindrome
strings using the above function.
OR
Write a program for storing the register number, name and marks of four [7] CO2 K3
6.a
subjects of a set 70 students into an array of structure. Display the details of
students who secured highest mark in each subject.
[7] CO3 K3
6.b Define a structure for storing acomplex number. Write functions for finding
the sum, difference and product of two complex numbers. Write a program for
inputing two complex numbers and display their sum, difference and product
using the above functions.
Module IV

[9] CO4 K3
7.a Write the definition of the functions whose prototype is given below:
(a) int StringLength(char *s); / returns the length of the string.
(b) void StringConcatenate (char *s1, char *s2); //Concatenate string
s2 to sl.
(c) void StringCopy(char *s1,char *s2); /string s2 is copied to string sl
7.b (i)Write the pointer representation of a<illil
CO4 K3
(i) static int a[2][3]={{1, 2, 3},{4, 5, 6}}; int (*p)[3):
p=a; p++; printf(%d", *(*p+2);
(iii) char *s="ABCDEFGH":

printf(%c %cn", *s+1, *(s+1));


(iv) int *p,*q, a[5]; p=a; q=&a[3];
What is the data type of p+3 and q-p ?
(v) Define an array of character pointers and intialize it with names of
days in a week.

OR

8.a Write a C program for copying the content of a text file to another file [7] COS K3

after converting all lower case letters to uppercase letters.


[71 CO5 K3
8.b Write a C program for implementing the wC command in UNIX.
(The wc command will display the number of lines, number of words and
number of characters in a text file whose name is given as command line
argument.)

Course Outcomes

CO2: Develop C programs using arrays, matrices, strings and structures.

CO3: Utilize functions to find solutions to the computational problems by dividing it intoa number
of modules and abstract data types
CO4:Develop C programs using pointers for dynamic data handling.
CO5: Use files in Cto permanendy store and manipulate data.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy