Skip to content

CodeGoura/Practical_BCA1st

Repository files navigation

Practical: Programming Fundamentals using C Lab

Practical C Programming Exercises

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.

List of Programs

  1. Find the Greatest Among Three Numbers

    • Description: A program that takes three numbers as input and finds the greatest of the three.
    • View Solution
  2. Arithmetic Operations Using Switch Case

    • Description: A calculator program that performs addition, subtraction, multiplication, and division based on user input using a switch statement.
    • View Solution
  3. 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
  4. Reverse a Number

    • Description: A program to reverse the digits of a given number.
    • View Solution
  5. Sum of First n Terms of Series S = 1 + 1/2 + 1/3 + ...

    • Description: This program computes the sum of the first n terms of a harmonic series.
    • View Solution
  6. Sum of First n Terms of Alternating Series S = 1 - 2 + 3 - 4 + ...

    • Description: A program that computes the sum of the first n terms of an alternating series.
    • View Solution
  7. 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
  8. 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
  9. Compute Factors of a Given Number

    • Description: A program that prints all factors of a given number.
    • View Solution
  10. Swap Two Numbers Using a Macro

    • Description: A program that swaps two numbers using a preprocessor macro.
    • View Solution
  11. 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
  12. 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
  13. 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
  14. Swap Two Numbers Using Pointers

    • Description: A program that swaps two numbers using pointer variables.
    • View Solution
  15. 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
  16. 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
  17. Sum and Average of Elements (Using Dynamic Memory)

    • Description: A program that calculates the sum and average of n elements entered by the user, using dynamic memory allocation (malloc/calloc).
    • View Solution
  18. 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
  19. Merge Two Ordered Arrays

    • Description: A program that merges two ordered arrays into one sorted array.
    • View Solution
  20. Copy Content from One File to Another

    • Description: A file-handling program that copies the content of one file to another.
    • View Solution

How to Run

  1. Clone this repository:
    git clone [Source_code](https://github.com/CodeGoura/Practical_BCA1st.git)
  2. Navigate to the program folder:
    cd gh repo clone CodeGoura/Practical_BCA1st
  3. Compile any C program using a C compiler, for example:
    gcc q1_greatest.c -o greatest
  4. Run the compiled program:
    ./greatest.exe

Contribution

Feel free to submit pull requests for improvements or additional programs. Contributions are welcome!

License

This repository is licensed under the GNU License.


[View Solution] (https://github.com/CodeGoura/Practical_BCA1st)

About

Practical: Programming Fundamentals using C Lab

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages