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

C Programming Sem2 Important Questions FYBSc CS

The document outlines important C programming questions for Semester 2 of FY BSc CS, covering topics such as functions, arrays, strings, pointers, structures, unions, file handling, and dynamic memory allocation. It includes explanations, definitions, and programming tasks related to each topic. The document serves as a study guide for students preparing for their exams.

Uploaded by

aboliwable96k
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)
6 views2 pages

C Programming Sem2 Important Questions FYBSc CS

The document outlines important C programming questions for Semester 2 of FY BSc CS, covering topics such as functions, arrays, strings, pointers, structures, unions, file handling, and dynamic memory allocation. It includes explanations, definitions, and programming tasks related to each topic. The document serves as a study guide for students preparing for their exams.

Uploaded by

aboliwable96k
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

Important C Programming Questions - Semester 2 (FY BSc CS)

Functions and Recursion

- Explain function declaration, definition, and call with example.

- Differentiate between call by value and call by reference.

- Write a program to find factorial using recursion.

- Write a program to check if a number is prime using a function.

- Explain scope and lifetime of variables in functions.

Arrays and Strings

- Write a program to find the largest element in an array.

- Write a program to sort an array in ascending order.

- Explain 2D arrays with syntax and example.

- What are strings? How are they declared and initialized in C?

- Write a program to reverse a string without using string functions.

- Explain any three standard string library functions with syntax.

Pointers

- Define pointers. How are they declared and initialized?

- Write a program to swap two numbers using pointers.

- Difference between array and pointer.

- Write a program to find the sum of elements in an array using pointers.

- Explain pointer to pointer with example.

Structures and Unions

- Define structure. How is it different from array?

- Write a program to accept and display student details using structure.

- What is a nested structure? Explain with example.

- Define union. Difference between structure and union.


- Explain array of structures with an example.

File Handling

- Explain how to open, read, write, and close a file in C.

- Difference between text file and binary file.

- Write a program to write and read data from a text file.

- Explain file I/O functions: fopen(), fclose(), fprintf(), fscanf().

- Write a program to count number of characters, words, and lines in a file.

Dynamic Memory Allocation

- What is dynamic memory allocation? List related functions.

- Difference between malloc(), calloc(), realloc(), and free().

- Write a program to allocate memory for an array using malloc().

- Explain memory leak and how to avoid it.

- Why is free() function important?

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