This repository contains solutions to a set of commonly asked C programming questions. Each problem is designed to reinforce various concepts such as control structures, functions, pointers, and arrays.
-
Find the Greatest Among Three Numbers
- Description: A program that takes three numbers as input and finds the greatest of the three.
- View Solution
-
Arithmetic Operations Using Switch Case
- Description: A calculator program that performs addition, subtraction, multiplication, and division based on user input using a
switchstatement. - View Solution
- Description: A calculator program that performs addition, subtraction, multiplication, and division based on user input using a
-
Sum and Product of Digits of an Integer
- Description: A program that calculates the sum and product of the digits of an integer entered by the user.
- View Solution
-
Reverse a Number
- Description: A program to reverse the digits of a given number.
- View Solution
-
Sum of First n Terms of Series S = 1 + 1/2 + 1/3 + ...
- Description: This program computes the sum of the first
nterms of a harmonic series. - View Solution
- Description: This program computes the sum of the first
-
Sum of First n Terms of Alternating Series S = 1 - 2 + 3 - 4 + ...
- Description: A program that computes the sum of the first
nterms of an alternating series. - View Solution
- Description: A program that computes the sum of the first
-
Check if String is Palindrome
- Description: A function to check if a string is a palindrome. It also includes a main program that prompts the user for a string and checks if it's a palindrome.
- View Solution
-
Check if a Number is Prime & Generate Primes Less Than 100
- Description: A function to check if a number is prime, and a main program that uses this function to generate all primes less than 100.
- View Solution
-
Compute Factors of a Given Number
- Description: A program that prints all factors of a given number.
- View Solution
-
Swap Two Numbers Using a Macro
- Description: A program that swaps two numbers using a preprocessor macro.
- View Solution
-
Print a Triangle of Stars
- Description: This program prints a triangle of stars based on the number of lines entered by the user.
- View Solution
-
Array Operations
- Description: A menu-driven program that performs various operations on an array such as printing even/odd values, calculating sum/average, finding max/min, removing duplicates, and printing the array in reverse order.
- View Solution
-
Count Occurrences of Each Alphabet (Command Line Arguments)
- Description: A program that counts the occurrences of each letter in a string passed via command-line arguments.
- View Solution
-
Swap Two Numbers Using Pointers
- Description: A program that swaps two numbers using pointer variables.
- View Solution
-
Pass Addresses to a Function and Alter Their Contents
- Description: A program in which a function is passed the addresses of two variables and alters their contents.
- View Solution
-
Calculate Area and Circumference of a Circle
- Description: A program that calculates the area and circumference of a circle given its radius. The computation is done in a separate function.
- View Solution
-
Sum and Average of Elements (Using Dynamic Memory)
- Description: A program that calculates the sum and average of
nelements entered by the user, using dynamic memory allocation (malloc/calloc). - View Solution
- Description: A program that calculates the sum and average of
-
Menu-driven String Operations
- Description: A menu-driven program that performs various string operations such as showing addresses, concatenation, comparison, length calculation, case conversion, counting vowels, and reversing the string.
- View Solution
-
Merge Two Ordered Arrays
- Description: A program that merges two ordered arrays into one sorted array.
- View Solution
-
Copy Content from One File to Another
- Description: A file-handling program that copies the content of one file to another.
- View Solution
- Clone this repository:
git clone [Source_code](https://github.com/CodeGoura/Practical_BCA1st.git)
- Navigate to the program folder:
cd gh repo clone CodeGoura/Practical_BCA1st - Compile any C program using a C compiler, for example:
gcc q1_greatest.c -o greatest
- Run the compiled program:
./greatest.exe
Feel free to submit pull requests for improvements or additional programs. Contributions are welcome!
This repository is licensed under the GNU License.
[View Solution] (https://github.com/CodeGoura/Practical_BCA1st)