-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction.c
More file actions
84 lines (63 loc) · 990 Bytes
/
function.c
File metadata and controls
84 lines (63 loc) · 990 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//even odd using function
#include<stdio.h>
int even_odd(int);
int main()
{
int n;
printf("we are going to calculate whether a number is even or odd");
printf("\n Enter number : ");
scanf("%d",&n);
int flag = even_odd(n);
if(flag==0)
printf("it's a even number");
else
printf("it's a odd number");
return 0;
}
int even_odd(int n)
{
if(n%2==0)
{
return 0;
}
else
{
return 1;
}
}
#include<stdio.h>
void display(int x[])
{
int i;
for(i=0;i<5;i++)
{
printf("%d ",x[i]);
}
}
int main()
{
int num[]={10,20,30,40,50};
display(num);
return 0;
}
//finding max element
#include<stdio.h>
int maxumum(int x[])
{
int i;
int mx = x[0];
for(i=0;i<5;i++)
{
if (x[i]>mx)
mx = x[i];
}
return mx;
}
int main()
{
int mx;
int num[]={10,20,30,40,50};
maxumum(num);
printf("%d",mx);
return 0;
}