Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

c programs

This repository contains basic C programs that demonstrate fundamental concepts in C programming. These programs are ideal for beginners to understand operators, data types, and simple conditional logic.

Filename Concept Demonstrated Description
arithmetic_operators.c Arithmetic Operators Demonstrates +, -, *, /, % operations, integer vs float division, and type casting.
relational_operators.c Relational Operators Shows >, <, ==, >=, <=, != operators and expression comparison.
assignment_operators.c Assignment Operators Demonstrates =, +=, -=, *=, /=, %= operators and how variables are updated.
conditional_operator.c Conditional (Ternary) Operator Uses ? : to make decisions and assign values based on conditions.
conditional_operator_pass_fail.c Conditional Operator Example Checks if marks are PASS or FAIL using ternary operator.
biggest_of_two.c Conditional Operator Example Finds the bigger of two numbers using the ternary operator.
variable_bytes.c Data Types & Size Demonstrates the number of bytes used by different C data types.
overflow_underflow.c Variable Limits Shows what happens when assigning values beyond the min/max of short int and int.

Key Concepts Covered

1.)Arithmetic Operators: Performing addition, subtraction, multiplication, division, and modulus.

2.)Relational Operators: Comparing values and evaluating expressions (>, <, ==, etc.).

3.)Assignment Operators: Shorthand operators to update variables (+=, -=, etc.).

4.)Conditional (Ternary) Operator: Compact if-else logic for decision-making.

5.)Data Types & Sizes: Understanding memory usage of different types (int, float, char, etc.).

6.)Overflow & Underflow: Demonstrating what happens when a value exceeds the limits of a variable.

About

Thia is my first c program

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages