askisi1

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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
* Omada Ergasias:
                 Dimitris Pericleous       A'Etos,AM: 7399
                 Kotsonis Giorgos          A'Etos,AM: 7397
                 Imerominia Sigrafis:      18/4/2017
                 Leitourgia Programmatos:  Programma pou diavazei akeraious kai kanei elegxous 
*/

#include<stdio.h>
#include<stdlib.h>

int main()
{
	int sum1,sum2,sum3=0;
	int num1,num2,num3;
	int num4,num5,num6;
	
	printf("give a number1:");
	scanf("%d",&num1);
	/*elegxei an o arithmos ine ektos ton orion 0-10
	ke diavazei ksana mexri o xristis na dosei
	arithmo mesa sta sosta oria */
	while(num1<0||num1>10)
	{
	printf("give a number1 from 0 to 10:");
	scanf("%d",&num1);
	}	
	
	printf("give a number2:");
	scanf("%d",&num2);
	while(num2<0||num2>10)
	{
	printf("give a number2 from 0 to 10:");
	scanf("%d",&num2);
	}	
	
	printf("give a number3:");
	 scanf("%d",&num3);
	
	while(num3<0||num3>10)
	{
	printf("give a number3 from 0 to 10:");
	scanf("%d",&num3);
	}	
	
	//ta athrismata ton zevgarion
	sum1=num1+num2;
	sum2=num1+num3;
	sum3=num2+num3;
	//elegxi an to athrisma ton proton dio arithmon isute me to trito arithmo
	if(sum1==num3)
	{
		printf("numbers are :%d %d %d ,from sum1(num1+num2)",num1,num2,num3);
	}
	//elegxi an to athrisma tou protou kai tritu arithmu isute me ton deftero
	else if(sum2==num2)
	{
		printf("\nnumbers are :%d %d %d , from sum2(num1+num3)",num1,num2,num3);
	}
	//elegxi an to athrisma tu defterou kai tritu arithmou isute me ton proto arithmo
	else if(sum3==num1)
	{
		printf("\nnumbers are :%d %d %d ,from sum3(num2+num3)",num1,num2,num3);
	}
	//an den isxyei tipota apo ta pio pano
	else 
		printf("nothing equal ");
	
	printf("\n");
	//DEFTERO KOMMATI TIS ASKISIS	
	
	//diavazi tous neous treis akereous arithmous
	printf("Give numbers for num4:");
	 scanf("%d",&num4);
	printf("Give numbers for num5:");
	 scanf("%d",&num5);
	printf("Give numbers for num6:");
	 scanf("%d",&num6);
	 
	 
	/*elegxi an o arithmos ine pollaplasios tu 6 ke diaforos apo to 20*/
	
	if(num4 % 6 ==0)
	  printf("\nnumber is module 6 is 0(pollaplasio tou6)\n");
	else if(num4!=20)
	  printf("\nnumber4 is:=%d",num4); 
	  
	printf("\n");

	if(num5 % 6 ==0)
	  printf("\nnumber is module 6 is 0(pollaplasio tou6)\n");
	else if(num5!=20)
	  printf("\nnumber5 is:=%d",num5);
	   
	printf("\n");

	if(num6 % 6 ==0)
	  printf("\nnumber is module 6 is 0(pollaplasio tou6)");
	else if(num6!=20)
	  printf("\nnumber6 is:=%d",num6);
	
	
	system("pause");
	return 0;	
}