0% found this document useful (0 votes)
39 views2 pages

C Programming Exam Questions

c-programming bim 1st semester

Uploaded by

022bim039
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)
39 views2 pages

C Programming Exam Questions

c-programming bim 1st semester

Uploaded by

022bim039
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

TRIBHUVAN UNIVERSITY

FACULTY OF MANAGEMENT
Full Marks: 40
Office of the Dean Time: 2 hrs.
2010
BIM/ Second Semester/ITC 213: Structured Programming
Candidates are required to answer the questions in their own words as far as practicable
Group ‘A’

1. Brief Answer Questions: [10×1=10]


i. Does main function have any arguments? If yes then list the arguments.
ii. Write the relationship between array and pointer.
iii. Make a distinction between if statement and switch statement.
iv. If concept of array was not present in programming language then what might be the problem?
v. Define double pointer variable.
vi. Why dynamic memory allocation concept is used in programs?
vii. Write the use of fseek function with its complete argument list.
viii. What do you mean by format string in C language? Write any two of them.
ix. Write the limitation of the return statement.
x. How union helps to save memory?

Group ‘B’
2. Write the use of memmove and memcmp functions with their argument list. [2]
3. A book record consists of its title, author, pages and price.
Write a program to perform operations. [8]
a. Read the records of 13 books.
b. Create at least one structure pointer to display the records of 13 books.
c. Store records of all 13 books in the file “[Link]”.
d. Read only the information of 9 books from “[Link]” skipping 2 books from first and 2 books
from last and display in terminal.

Group ‘C’

Attempt any FOUR questions: [4×5=20]


4. Write a program to find the second largest among three numbers.
5. Write a program that reads the elements of two matrices A34 and A43 then perform and B×A and A×B.

6. Write a program to display the reverse of a number using recursion.


7. Explain the given program and write the result when the program is executed.
[Link]
# include <stdio.h>
# include <conio.h>
# include <string.h>

Int main ( )
{
char *ppp = “ Programming language.”;
char **p = &ppp;
printf(“\n%s AND %s”, *p, ppp);
pp = strlen (*p);
printf (“ \ n % 4 d \ n % 4 d\ n % 4 d\ n % 4 d\ n % 4 d\n”, pp--,pp,++pp, pp++, --pp);

if (strcmp (“abandon”, “abandonment”) <=0)


pp = 10;
printf (“value of pp = %d”, pp);
getch ( );
return 0;
}
8. Write a program that reads character and perform following operation according to the choice inputted by the
user.
a. Displays “it is vowel” if entered character is vowel otherwise “it is consonant”.
b. Displays “it is digit” if entered character is member of digit, otherwise display the ASCII value of
entered character.

[Link]

You might also like