Skip to content

This repository contains a collection of simple C programs designed to demonstrate various basic programming concepts. Each program is described below with its functionality and expected output.

Notifications You must be signed in to change notification settings

rezapace/c--program

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple C Programs

This repository contains a collection of simple C programs designed to demonstrate various basic programming concepts. Each program is described below with its functionality and expected output.

Program 1: Conditional Branching in C

  • Description: Determines the grade based on the score.
  • Conditions:
    • If the score is less than or equal to 40, the grade is D.
    • If the score is less than or equal to 60, the grade is C.
    • If the score is less than or equal to 80, the grade is B.
    • Otherwise, the grade is A.

Program 2: Output Program

  • Description: Displays a specific message.
  • Output:
    • "Your score is 50"
    • "Sorry, you did not pass"

Program 3: Odd Numbers from 1 to 100

  • Description: Prints all odd numbers between 1 and 100.

Program 4: Triangle Area Calculator

  • Description: Calculates the area of a triangle.
  • Parameters:
    • Base
    • Height

Program 5: String Character Count

  • Description: Counts the number of characters in a string.
  • Input: The string "Programmer".

Program 6: Triangle Area Calculation

  • Description: Calculates the area of a triangle.

Program 7: Rectangle Area Calculation

  • Description: Calculates the area of a rectangle.
  • Parameters:
    • Length
    • Width

Program 8: Circle Area Calculation

  • Description: Calculates the area of a circle.
  • Parameters:
    • Radius (r = 7)
    • Pi (π = 3.14)

Program 9: Even Numbers from 1 to 75

  • Description: Prints all even numbers between 1 and 75.

Program 10: Days of the Week Array

  • Description: Creates an array containing the names of the days of the week.
  • Example:
    • Day 1 is Monday
    • Day 2 is Tuesday

Program 11: Fibonacci Sequence

  • Description: Outputs the first 5 Fibonacci numbers.
  • Initial Terms:
    • First term = 6
    • Second term = 9

Program 12: Right-Angled Triangle with Stars

  • Description: Creates a right-angled triangle using stars.

Program 13: Full Triangle with Stars

  • Description: Creates a full triangle using stars.

Program 14: Simple Calculator

  • Description: Implements a basic calculator.

Program 15: Rectangle Area Calculation

  • Description: Calculates the area of a rectangle.

Program 16: Rectangle Area Calculation

  • Description: Calculates the area of a rectangle.

Program 17: Trigonometric Functions

  • Description: Calculates sine, cosine, and tangent values.

Program 18: Density Calculation

  • Description: Calculates the density of a substance.

Program 19: Counting to One Million

  • Description: Counts from 1 to 1,000,000 and displays the record.

Program 20: Cube Surface Area Calculation

  • Description: Calculates the surface area of a cube.

Program 21: Odd Numbers from 1 to 75

  • Description: Prints all odd numbers between 1 and 75.

Program 22: Data Input and Output

  • Description: Demonstrates basic data input and output operations.

Powered by Reza

About

This repository contains a collection of simple C programs designed to demonstrate various basic programming concepts. Each program is described below with its functionality and expected output.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages