-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction_programs.c
More file actions
47 lines (39 loc) · 811 Bytes
/
function_programs.c
File metadata and controls
47 lines (39 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <stdio.h>
// Without Parameter And Without Return Type Function
void hello(){
printf("Hello");
}
// With Parameter And Without Return Type Function
void sum(int a,int b){
printf("Sum of a and b is : - %d",a+b);
}
// Without Parameter And With Return Type Function
int add(){
int a=6;
int b=7;
int c=a+b;
return c;
}
// With Parameter And With Return Type Function
int addition(int a,int b){
int c=a+b;
return c;
}
void printArray(int array[],int arraySize){
for(int i=0;i<arraySize;i++){
printf(" %d ",array[i]);
}
}
void print2DArray(int array[3][3]){
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
printf(" %d ",array[i][j]);
}
printf("\n");
}
}
int main()
{
printf("Hello World");
return 0;
}