0% found this document useful (0 votes)
2 views2 pages

C Programs

The document outlines ten C programming examples, each accompanied by a simple algorithm describing the steps involved. The examples include adding two integers, checking for prime numbers, finding the largest of three numbers, calculating the area and perimeter of a circle, averaging N numbers, summing even numbers, calculating factorials, determining even/odd status, reversing a number, and checking for leap years. Each algorithm follows a structured format of starting with input, processing the data, and printing the result.

Uploaded by

abdulahadbapari
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

C Programs

The document outlines ten C programming examples, each accompanied by a simple algorithm describing the steps involved. The examples include adding two integers, checking for prime numbers, finding the largest of three numbers, calculating the area and perimeter of a circle, averaging N numbers, summing even numbers, calculating factorials, determining even/odd status, reversing a number, and checking for leap years. Each algorithm follows a structured format of starting with input, processing the data, and printing the result.

Uploaded by

abdulahadbapari
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

C PROGRAMS WITH ALGORITHM AND FLOWCHART

1. Add Two Integers

Algorithm:

Start → Input A,B → Sum=A+B → Print → End

2. Prime Number

Algorithm:

Start → Input N → Check divisibility → Print result → End

3. Largest of Three

Algorithm:

Start → Input A,B,C → Compare → Print largest → End

4. Circle Area & Perimeter

Algorithm:

Start → Input r → Area=πr² → Perimeter=2πr → Print → End

5. Average of N numbers

Algorithm:

Start → Input N → Loop → Sum → Avg=Sum/N → Print → End

6. Sum of even numbers

Algorithm:

Start → Input N → Loop (2 step) → Sum → Print → End

7. Factorial

Algorithm:

Start → Input N → Loop multiply → Print → End

8. Even/Odd

Algorithm:

Start → Input N → Check N%2 → Print → End

9. Reverse Number

Algorithm:
Start → Input N → Loop reverse → Print → End

10. Leap Year

Algorithm:

Start → Input Year → Apply conditions → Print → End

You might also like