Showing posts with label c program. Show all posts
Showing posts with label c program. Show all posts

22 January 2022

C Function Programs

                         Function Programs

 

Sr. No.

Program Definition

1

Define function with example. 

2

Define more than one function in one program.

3

Function calling function demo.

4

Recursion. Direct type demo.

5

Recursion. Indirect type demo.

6

Addition of two number using function.

(without return value, without argument)

7

Addition of two number using function.

(without return value, with argument)

8

Addition of two number using function.

(with return value, without argument)

9

Addition of two number using function.

(with return value, with argument)

10

Star print with function.

11

Function pattern print.

12

No return value, with argument: addition of three numbers

13

No return value, with argument: reverse number

14

No return value, with argument: square of number

15

No return value, No argument: swapping of two number

16

No return value, with argument: swapping of two number

17

with return value, no argument .. square of number

18

with return value, without argument ..  addition of two number

19

with return value, without argument .. reverse number

20

With return value, with argument .. square of number

21

With return value, with argument .. addition of two number

22

with return value, with argument .. reverse number

23

with return value, No argument: swapping of two number

24

with return value, with argument: swapping of two number

25

With return value, with argument: multiplication of three numbers

       

C Function Program Solutions 

02 January 2022

C Pattern Programs

 Click on Pattern for Code


Sr. No.

Pattern

1

*

**

***

****

*****


2

*****
****
***
**
*

 

3

11111
2222
333
44
5



4

12345

2345

345 

45

5

 

5

55555

4444

333

22

1

 

6

1

13

135

1357

13579

 

7

5

5 4

5 4 3

5 4 3 2

5 4 3 2 1

 

8

1

2 1

3 2 1

4 3 2 1

5 4 3 2 1

 

9

5

4 5

3 4 5

2 3 4 5

1 2 3 4 5

 

10

5 4 3 2 1

5 4 3 2

5 4 3 

5 4

5

 

11

1

1 2

1 2 3

1 2 3 4

1 2 3 4 5

 

12

1 2 3 4 5

1 2 3 4

1 2 3

1 2

1

 

13

5 4 3 2 1

4 3 2 1

3 2 1

2 1

1

 

14

5

4 4

3 3 3 

2 2 2 2

1 1 1 1 1

 

15

1

2 2 

3 3 3

4 4 4 4

5 5 5 5 5

 

16

1

3 1

5 3 1

7 5 3 1

9 7 5 3 1

 

17

9 7 5 3 1

7 5 3 1

5 3 1

3 1

1

 

18

1 3 5 7 9

1 3 5 7 

1 3 5

1 3 

1

 

19

1

1 3

1 3 5

1 3 5 7

1 3 5 7 9

 

20

1

3 1

5 3 1

7 5 3 1

9 7 5 3 1

 

21

1 3 5 7 9

1 3 5 7

1 3 5

1 3 

1

 

22

9 7 5 3 1

7 5 3 1

5 3 1

3 1

1

 

23

1

1 5

1 5 10

1 5 10 15

1 5 10 15 20

 

24

1 5 10 15 20

1 5 10 15

1 5 10

1 5 

1

 

25








20 15 10 5 1

15 10 5 1

10 5 1

5 1

1       


26

1

2 3

3 4 5

4 5 6 7

5 6 7 8 9


27

1

2 3

4 5 6

7 8 9 10

11 12 13 14 15

 

28

1

0 1

1 0 1

0 1 0 1

1 0 1 0 1

 

29

1

1 0

1 0 1

1 0 1 0

1 0 1 0 1

 

30

     1

   121

  12321

 1234321

123454321

 1234321

  12321

   121

     1

 

31

        1
          131
    13531
  1357531
135797531 
  1357531
    13531   
      131
        1


32

     1

   101

  10101

 1010101

101010101

 1010101

  10101

   101

    1

33

     1

   222

  33333

 4444444

555555555

 4444444

  33333

   222

     1

 

34

     *

   ***

  *****

 *******

*********

 *******

  *****

   ***

     *