11 November 2022

Array

 

Array:

 

#include<stdio.h>

#include<conio.h>

 

void main()

{

                int i, no[10];

                clrscr();

                printf(“Enter values in an array”);

                printf(“--------------------------------“);

 

                // Input/ Scan the numbers

                for(i=0; i<10; i++)

                {

                printf(“Enter value %d”, i+1);

                scanf(“%d”, &no[i]);

}

 

// Output/ Print the numbers

for(i=0; i<10; i++)

                {

                printf(“Value %d is %d”, i+1, no[i]);         

}

                getch();

}

 

 

Exercise:

1. Define an array of 5 employee. Enter the id number of 5 employee and print it.

2. Define an array of 5 students. Enter the percentage of 5 studnets and print it.

 

08 November 2022

C Programming Language Function Program

                                   Exercise Date: 08/11/2022

 

                                        For A&B Division                          

                                       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 

===============================================