-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain2.c
47 lines (38 loc) · 846 Bytes
/
main2.c
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>
#include <stdlib.h>
int Numbers(int a,int b, int c)
{
int total = a+ b+ c;
return total;
}
int main()
{
int total = Numbers(10,20,30);
int lastTotal = Numbers(total,total,total);
printf("lastTotal : %d\n",lastTotal);
int i = 1;
while(i<=10){
if(i%2==0){
printf("Even numbers:");
printf("%d\n",i);
}
i++;
}
int number;
do
{
printf("Enter a number: "); scanf("%d",&number);
printf("%d * 2 = %d(Press the number 5 to exit)\n",number,number*2);
}while(number !=5);
int j;
for (j=0;j <10;j++){
printf("%d\n",j);
}
int array[] = {10,20,30,40};
int k;
for(i=0;i<4;i++)
{
printf("Number: %d\n",array[i]);
}
return 0;
}