Skip to content

Latest commit

Β 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 

Repository files navigation

C Language Logo

Typing SVG

A collection of my C programming algorithms, logic building exercises, and academic codes for my B.Tech CSE (AI & DS).

Language C GCC Compiler Status


πŸ“Œ OVERVIEW

This repository tracks my progress while learning the fundamentals of C programming. The examples focus on variables, input and output, arithmetic, conditionals, and basic problem-solving.

πŸ“‚ SIMPLE ALGORITHMS

All examples are stored in the Simple Algorithms directory. Each program is a standalone C file with its own main function.

File What it does Main concepts
absolute.c Finds the absolute value of an integer. if-else, unary negation
age_vote.c Calculates age from a birth year and checks voting eligibility. Input, arithmetic, conditionals
average.c Calculates the average of three integers. Arithmetic operators, integer division
conditional_swap.c Updates three values conditionally and prints their sum. Nested conditionals, arithmetic
division.c Divides two user-provided numbers. float, input, arithmetic
interest.c Calculates simple interest. Formula translation, float
leap_year.c Checks whether a year is a leap year. Logical operators, modulo operator
numcheck.c Identifies whether a number is positive, negative, or zero. if-else if-else, comparisons
scan_sub.c Subtracts one user-provided integer from another. scanf, variables, arithmetic
sum.c Adds two predefined integers. Variables, assignment, printf
swap.c Swaps two integers using a temporary variable. Assignment, temporary storage
tax.c Calculates tax and the final price of a product. Percentages, float, arithmetic
time_convertor.c Converts days into hours, minutes, and seconds. Unit conversion, arithmetic

βš™οΈ HOW TO RUN

You need a C compiler such as GCC. On Windows, MinGW-w64 is a common choice.

Clone the repository and open the examples directory:

git clone https://github.com/im-nitin/C.git
cd "C/Simple Algorithms"

Compile a program and run it. Replace sum with any filename from the table:

gcc sum.c -o sum

On Windows PowerShell:

.\sum.exe

On Linux or macOS:

./sum

Most programs read values from standard input. Follow the prompts after starting the executable.

🧭 LEARNING FOCUS

  • C syntax, variables, and data types
  • Console input and output with scanf and printf
  • Arithmetic and percentage calculations
  • Conditional logic and comparison operators
  • Translating everyday problems into small algorithms

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages