Skip to content

KUSHAGRA-JAISWAL/C-Programming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C_Programming



C programming language was developed in 1972 by Dennis Ritchie at bell laboratories of AT&T (American Telephone & Telegraph), located in the U.S.A. Dennis Ritchie is known as the founder of the c language. It was developed to overcome the problems of previous languages such as B, BCPL, etc.

This repository is the collection of C Programs that has been done While Learning C as well as the collection of the program that were done while solving heavy Challenges.

NOTE:- All the Notes are Included inside the Programs.

This repo has divided into three main categories that covers:-

  1. Learning Sections:- This section have 11 categories contaning all the programs that will help you to understand all the Basic as well as Advance Concepts of C programming.

  2. Challenges:- This Section Contains 11 Practice Sets which is Depend on all the 11 Learning sections. You may have a look on it.

  3. Projects:- This Section Contains the Projects releated to C programming.

Our Discord's!

Join us at (HackerSpace)

Join us at (h̲a̲c̲k̲e̲r̲s̲ ̲s̲e̲r̲v̲e̲r̲)


Compile & Run C programs

⭐Compilation

  ( gcc program_name.c ):    This will compile your program at the same location with the name a.out / a.exe .

  ( gcc program_name.c -o xyz ):    This will compile your program at the same place but if you use -0 it will give a custom name to your compiled program, in this case it is xyz.

  ( gcc program_name.c -o ../../out/xyz ):    This will compile your program at the location where you want to save with the name you want, in my case it is xyz.

⭐Run

  ( ./program_name ):    Writting this at the location where your program is compiled, it will run your C program.

Learning Section

Section_1_Variables, Constants & Keywords

Programs Discription
1. first.c: The very first C program to print the text you want to print.
2. variables.c: Program to Understand the concepts of Variables.
3. addition.c: Program to Understand the concept of adding two numbers.
4. input.c: Program to Understand how to take input from the user.

Section_2_Instructions & Operators

Programs Discription
1. operator_precidence.c: Program to Understand the concept of Operator Precidence.
2. type_declaration_instruction.c: Program to Understand the concepts of Type Declaration Instruction.
3. arithmetic_instruction.c: Program to understand the Concepts of Arithmetic Instruction.

Section_3_Conditional Instructions

Programs Discription
1. logical_operators.c: Program to Understand the Concepts Logical Operators, Write a program to check age criteria is eligible for driving or not.
2. relational_operators.c: Program to Understand the Concepts Relational Operators, Write a program to check age criteria is eligible for driving or not.
3. conditional_operators.c: Program to Understand the Concepts of Conditional Operators, Write a program to check wheather a number is equal to 5 or not.
4. if_else.c: Program to Understand the Concepts of if & else, Write a program to check wheather a number is even or odd.
5. else_if.c: Program to Understand the Concepts of else if, Write a program to check wheather a number 1 or 2 or 3.
6. switch_case.c: Program to Understand the Concepts of Switch Case, Write a program to give rating to a hotel service between 1 to 5.

Section_4_Loop Control Instructions

Programs Discription
1. loops_introduction.c: Program to Understand the concepts of Loops.
2. increment_decrement_operator.c: Program to Understand the Concepts of Increment and Decrement Operators.
3. for_loop.c: Program to Understand the concepts of for loop.
4. while_loop.c: Program to Understand the Concepts of While Loop, Take any number less then 10 input from the user and print till 10.
5. do_while_loop.c: Program to Understand the Concepts of Do While Loop.Take any number less then 10 input from the user and print till 10.
6. break_in_loop.c: Program to Understand the Concepts of Break Statement in Loops.
7. continue_in_loop.c: Program to Understand the Concepts of Continue Statement in Loops.

Section_5_Functions & Recursions

Programs Discription
1. functions.c: Program To Understand the concepts of Functions.
2. sum_function.c: Program to make a user defined function named sum which can perform addition between two numbers.
3. area_square_library_function.c: Program to calculate area of square using library function.
4. function_inside_function.c: Program to Understand the Concepts of Functions insdie the Function.
5. recurrison_factorial.c: Program to Understand the concepts of recurrison.

Section_6_Pointers

Programs Discription
1. pointer_basics.c: Program to Understand the Concepts of Pointers.
2. call_by_refrence.c: Program to Understand the concepts of Call by Reference.
3. call_by_value.c: Program to Understand the concepts of Call by value.

Section_7_Arrays

Programs Discription
1. arrays_basic.c: Program to Understand the concepts of Arrays.
2. arrays_initializations.c: Program to Understand the different ways of initializations in Arrays.
3. arrays_input.c: Program to Understand Concepts of taking input from the user in arrays and display output.
4. arrays_input_using_loops.c: Program to Understand How to take input from the user in arrays with the help of loops and display output.
5. arrays_to_functions.c: Program to Understand Concepts of passing the array to the function.
6. arrays_with_pointers.c: Program to Understand Concepts of taking input and output using pointers in Arrays.
7. multidimensional_arrays.c: Program to Understand Concepts of Multidimensional Arrays like 2D array , 3d array.
8. pointer_arthmetics.c: Program to Understand the Concepts of pointer arthmetics.

Section_8_Strings

Programs Discription
1. strings_basic.c: Program to Understand the concepts of Strings.
2. user_input_strings.c: Program to understand the concept of taking input fron the users in strings.
3. diff_bw_two_init_methods.c: Program to understand the difference between two init methods in strings.
4. convenient_way_print_strings.c: Program to understand the concept of printing the string in convenient way.
5. strlen.c: Program to understand the Concept of Strlen function in strings.
6. strcpy.c: Program to understand the Concept of Strcpy function in strings.
7. strcmp.c: Program to understand the Concept of strcmp function in strings.
8. strcat.c: Program to understand the Concept of strcat function in strings.
9. gets_puts.c: Program to understand the concept of gets() and puts() in strings.

Section_9_Structures

Programs Discription
1. structures.c: Program to Understand the concepts of Structures.
2. another_way_to_init_structures.c: Program to Understand the concept of Another way to initialize Structures.
3. typedef.c: Program to Understand the concept of typedef keyword in structures.
4. array_of_structures.c: Program to Understand the concept of Array of Structures.
5. structures_to_function.c: Program to Understand the concept of passing structures to a function.
6. pointer_to_structures.c: Program to Understand the concept of pointer to Structures.

Section_10_File I/O

Programs Discription
1. files_basic.c: Program to Understand the concepts of Files I/O.
2. files_reading.c: Program to Understand the concepts of Reading the Files.
3. files_writting.c: Program to Understand the concepts of Wrritting the Files.
4. fgetc.c: Program to Understand the concepts of fgetc in the Files.
5. fputc.c: Program to Understand the concepts of fputc in the Files.
6. files_read_fgetc.c: Program to Understand the concepts of (END OF FILE)EOF & how to read the whole file using fgetc.

Section_11_Dynamic_Memory_Allocation

Programs Discription
1. dynamic_memory_location.c: Program to Understand the concepts of Dynamic Memory Allocation.
2. malloc.c: Program to Understand the concepts of malloc() in Dynamic Memory Allocation.
3. calloc.c: Program to Understand the concepts of calloc() in Dynamic Memory Allocation.
4. free.c: Program to Understand the concepts of free() in Dynamic Memory Allocation.
5. realloc.c: Program to Understand the concepts of realloc() in Dynamic Memory Allocation.

Challenges

Practice_Set_1_Variables, Constants & Keywords

Programs Discription
1. area_of_reactangle.c: Write a Program to take input from the user and calculate the area of the Reactangle.
2. area_of_circle.c: Write a Program to take input from the user and calculate the area of the Circle.
3. volume_of_cylinder.c: Write a Program to find the volume of the Cylinder.
4. simple_intrest.c: Write a Program to calculate Sinple Intrest.
5. celcius_to_farenheit.c: Write a Program to convert Celcius to Farenheit.

Practice_Set_2_Instructions_&_Operators

Programs Discription
1. calculation.c: Write a Program to perform basic calculations like Addition,Subtraction,Multiplication,Division.
2. divisible_by_97_or_not.c: Write a Program to determine wheather a number is divisible by 97 or not.
3. explain_step_evaluation.c: Explain step by step evaluation of (3 * x / y - z + k), Where x=2, y=3, z=3, k=1.

Practice_Set_3_Conditional_Instructions

Programs Discription
1. upper_and_lowercase.c: Write a program to find chatacter is in Lower case or in Upper case, take character as input from user.
2. find_grade.c: Write a program to find the grade of a student given his marks based on bellow:-
3. pass_fail.c: Write a program to find out wheather a student is pass or fail, if it requires total 40% and at least 33% in each subject to pass. Assume three subjects and take marks as input from the user.
4. greatest_among_4.c: Write a program to find the gratest number among 4 numbers given by the user.
5. calculate_income_tax.c: Calculate income tax paid by an employee to the government as per the slabs mention below:-
6. identify_leap_year.c: Write a program to find wheather a year is leapyear or not take the year as input from the user.

Practice_Set_4_Loop_Control_Instructions

Programs Discription
1. quiz_for_loop.c: Write a Program to print first n natural numbers using for loop.
2. quiz_while_loop.c: Write a Program to print natural numbers from 10 to 20 when initial loop cointer i is initialized to 0.
3. quiz_do_while_loop.c: Write a Program to print first n natural numbers using do while loop.
4. repeat_8.c: Repeat 8 Using while loop.
5. sum_first_ten.c: Write a program to sum first ten natiral numbers using for, while and do whille loop.
6. table_of_n.c: Write a Program to print multiplication table of a given number n.
7. n_in_reverse_order.c: Write a Program to print first n natural numbers in reverse order using for loop.
8. prime_or_not.c: Write a Program to Check wheather it is Prime or not using loops.
9. factorial.c: Write a Program to calculate the factorial of a given number using for loop.

Practice_Set_5_Functions_&_Recursions

Programs Discription
1. quiz_functions.c: Write a program with three functions :
2. sum_natural_functions.c: Write a Program using recurrison to calculate sum of first n natural numbers.
3. left_trangle_pattern.c: Write a Program using function to print a left angle trangle pattern.
4. find_average_functions.c: Write a program using Functions to find average of three numbers.
5. force_attraction_functions.c: Write a function to calculate force of attraction on a body of mass m exerted by earth (g = 9.8m/s^2).
6. celcius_farenheit_functions.c: Write a function to convert celcius into farenheit.
7. fibonacci_recurrison_functions.c: Write a Program using recurrison to calculate n th element of fibonacci series.
8. must_solve.c: What will the following line produce when a = 3 in a C program. printf("%d %d %d \n", a, ++a, a++);

Practice_Set_6_Pointers

Programs Discription
1. quick_quiz_pointer.c: Write a Program to perform certain operations on pointer like:-
2. print_address_value.c: Write a Program to print the address of the variable, use this address to get the value of the variable.
3. increase_value_of_a.c: Write a Program to Change the value of a variable to 10 times of its current value. Write a function and pass the value by reference.
4. sum_average_using_pointer.c: Write a Program using a function which calculates the sum and average of two numbers. Use pointers and print the value of sum and average in main().
5. compare_address.c: Write a program having a variable i. Print the address of i, pass this variable to a function and print its address. Are these addresses same ? Why?
6. pointer_to_pointer.c: Write a program to print the value of variable i by using "pointer to pointer" type of variable.

Practice_Set_7_Arrays

Programs Discription
1. positive_integer_in_arrays.c: Write a program containing a function which count the number of positive integers in an arrays.
2. multiplication_table_arrays.c: Write a program to create an array of 10 integers and store multiplication table of 5 in it.
3. multiplication_table_user_arrays.c: Write a program to create an array of 10 integers and store multiplication table of n in it. Take the input from the user.
4. multiplication_table_of_multiple_numbers.c: Write a program to create an array of size 3 x 10 contaning multiplication table of the numbers 2, 7, 9 respectively.
5. multiplication_table_of_multiple_numbers_user.c: Write a program to create an array of size n x m contaning multiplication table of n numbers respectively. Take the input from the user.
6. reverse_arrays_through_function.c: Write a program containing a function which reverses the array pass to it.
7. verify_ptr_points_third_element.c: Write a program to create an array of 10 numbers. Vreify using pointer arthmetiic that (ptr+2) points to the third element where ptr is a pointer pointing to the first element of the array.
8. address_of_3D_arrays.c: Write a program to create a three dimensional array and print the address of its elements in increasing order.

Practice_Set_8_Strings

Programs Discription
1. user_made_strlen.c: Write a Program to Create your own version of strlen function from <string.h>.
2. user_made_strcpy.c: Write a Program to Create your own version of strcpy function from <string.h>.
3. slice_strings.c: Write a function slice(). to slice the string. It should change the original string such that it is now the sliced string. Take m and n as the start and the ending position of the slice.
4. print_strings_using_loop.c: Write a Program Create a string using " " and print it content using loop.
5. compare_strings_equal.c: Write a Program to take string as input from user using %c and %s. Conform that strings are equal.
6. char_in_string_or_not.c: Write a Program to check whether a given character is in the string or not.
7. count_occurence_char_strings.c: Write a Program to count the occurence of a given character in string.
8. encrypt_strings.c: Write a Program to encrypt a string by adding 1 to its ASCII value of its character.
9. dycript_strings.c: Write a Program to dycrypt a string by adding 1 to its ASCII value of its character.

Practice_Set_9_Structures

Programs Discription
1. quick_quiz_structures.c: Write a Program to store the details of 3 employees from user defined data.
2. sumvector_function.c: Write a function sumvector which returns the sum of two vectors passed to it. The vector must be two-dimensional.
3. 2D_vector_using_structures.c: Write a Program to create a two dimensional vector using structures in C.
4. user_complex_numbers.c: Write a Program, create an array of 5 complex numbers with the help of structures and display them with the display function. The value must be take as input from the user.
5. structures_of_date.c: Write a Program, Create a structure capable of storing dates. Write a function to compare those dates.
6. structures_of_time.c: Write a Program, Create a structure capable of storing time. Write a function to compare those time.
7. structures_bank_acc.c: Write a Program, Create a structure representing a bank account of a customer.
8. real_coder_date_time.c: Write a Program, Create a structure capable of storing Dates and date (date STAMP). Write a function to compare those dates and date.

Practice_Set_10_File_IO

Programs Discription
1. quick-quiz_files.c: Write a Program to check whether the file exists or not before opeaning the file.
2. read_three_integer.c: Write a Program to read three integer from the file.
3. read_write_twice.c: Write a Program to read the text file character by character and write its content twice in a seprate file.
4. multiplication_table_in_txt.c: Write a Program to generate multiplication table of a given number in text format. Make sure that the file is readable and well formated.
5. employee_data.c: Write a Program, Take name and sallery of two employees as input from the user and write that into the text file.

Practice_Set_11_Dynamic_Memory_Allocation

Programs Discription
1. quick_quiz_malloc.c: Write a Program to check whether the file exists or not before opeaning the file.
2. quick_quiz_calloc.c: Write a Program to create an array of size n using calloc() where n is a integer enterd by the user in Dynamic Memory Allocation.
3. realloc_multiplication_table.c: Write a Program, Create an array of multiplication table of 7 upto 10 (7 x 10 = 10). Use realloc to store 15 numbers (from 7 x 1 to 7 x 15).
4. malloc_realloc.c: Write a Program, Create an array dynamically capable of storing 5 integers. Now use realloc so it can now store 1o Integers.

Projects

Programs Discription
1. guess_the_number_v1.c: We will write a Program that generates a random number and asks the player to guess it. If the player's guess is higher than the actual number, the progrm displays "Lower Number Please". Similarly if the user's guess is too low, the program prints "higher Number Please". When the user guesses the correct number, the program display the number of guesses the player use to arrive at the number.
2. guess_the_number_v2.c: We will write a Program that generates a random number and asks the player to guess it. If the player's guess is higher than the actual number, the progrm displays "Lower Number Please". Similarly if the user's guess is too low, the program prints "higher Number Please". When the user guesses the correct number, the program display the number of guesses the player use to arrive at the number.
3. snake_water_gun.c: Snake, Water, Gun OR Rock, Paper, Scissor is a game most of us have played during school time. Write a C program Capabale of playing this game with you. Your program should be able to return the result after you choose snake / water or gun.

About

Best Learning Repo For C Programming

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages