fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. /*
  5. Name : kareem yasser abdlgwwad
  6. الاسم : كريم ياسر عبد الجواد
  7. Group : 3
  8. جروب 3
  9. Section : 3
  10. سكشن 3
  11. */
  12.  
  13. void Sheet_week1_1(){
  14. char _name_[60];
  15. scanf("%s",_name_);
  16. printf("Hello, %s",_name_);
  17. }
  18.  
  19. void Sheet_week1_2(){
  20. int t;
  21. double d;
  22. float f;
  23. char ch;
  24. scanf("%d %lf %f %c", &t, &d, &f, &ch);
  25. printf("%d \n%lf \n%f \n%c", t, d, f, ch);
  26. }
  27.  
  28. void Sheet_week1_3(){
  29. int _x_axis,_y_axis;
  30. scanf("%d %d", &_x_axis ,&_y_axis);
  31. printf("%d + %d = %d" , _x_axis ,_y_axis , _x_axis+_y_axis);
  32. printf("\n%d * %d = %d" , _x_axis ,_y_axis , _x_axis*_y_axis);
  33. printf("\n%d - %d = %d" , _x_axis ,_y_axis , _x_axis-_y_axis);
  34. }
  35.  
  36. void Sheet_week1_4(){
  37. int a,b,c,d;
  38. scanf("%d %d %d %d",&a ,&b ,&c ,&d);
  39. printf("Difference = %d", ( a * b )-( d * c ));
  40. }
  41.  
  42. void Sheet_week1_5(){
  43. float r;
  44. scanf("%f",&r);
  45. printf("%f", (r*r) * 3.141592653);
  46. }
  47.  
  48. void Sheet_week1_6(){
  49. int N,M;
  50. scanf("%d %d", &N, &M);
  51. printf("%d", N%10 + M%10 );
  52. }
  53.  
  54. void Sheet_week2_1(){
  55. int _number;
  56. scanf("%d", &_number);
  57.  
  58. for(int loop = 1 ; loop <= _number ; loop++)
  59. printf("%d\n",loop);
  60. }
  61.  
  62. void Sheet_week2_2(){
  63. int _number;
  64. scanf("%d", &_number);
  65.  
  66. for(int loop = (_number < 0 ? _number : 1) ; loop <= (_number > 0 ? _number : -1); loop++){
  67. if(loop%2==0)
  68. printf("%d\n",loop);
  69. }
  70. }
  71.  
  72. void Sheet_week2_3(){
  73.  
  74. int num_total;
  75.  
  76. int even = 0,odd = 0,postive = 0,negative = 0;
  77. scanf("%d", &num_total);
  78.  
  79. int _numbers[num_total];
  80.  
  81. for(int i = 0 ; i < num_total ; i++)
  82. scanf("%d",&_numbers[i]);
  83.  
  84. for(int loop = 0 ; loop < num_total ; loop++){
  85. if(_numbers[loop] % 2 == 0)
  86. ++even;
  87. else
  88. ++odd;
  89.  
  90. if(_numbers[loop] > 0)
  91. ++postive;
  92. else if(_numbers[loop] < 0)
  93. ++negative;
  94. }
  95.  
  96. printf("Even: %d\n",even);
  97. printf("Odd: %d\n",odd);
  98. printf("Postive: %d\n",postive);
  99. printf("Negative: %d\n",negative);
  100. }
  101.  
  102.  
  103. void Sheet_week2_4(){
  104.  
  105. int _numbers[5];
  106.  
  107. for(int i = 0 ; i < 5 ; i++)
  108. scanf("%d",&_numbers[i]);
  109.  
  110. for(int loop = 0 ; loop < 5 ; loop++){
  111. if(_numbers[loop] == 1999){
  112. printf("Correct\n");
  113. return 0;
  114. }
  115. else
  116. printf("Wrong\n");
  117. }
  118. }
  119.  
  120. void Sheet_week2_5(){
  121. int num_total;
  122.  
  123. int even = 0,odd = 0,postive = 0,negative = 0;
  124. scanf("%d", &num_total);
  125.  
  126. int _numbers[num_total];
  127.  
  128. for(int i = 0 ; i < num_total ; i++)
  129. scanf("%d",&_numbers[i]);
  130.  
  131. int comper1,comper2;
  132.  
  133. for(int start = 0 ; start < num_total ; start++)
  134. if (_numbers[start] > _numbers[start-1])
  135. comper1 = _numbers[start];
  136.  
  137. for(int end = num_total ; end > 0 ; end--)
  138. if (_numbers[end] > _numbers[5-end])
  139. comper2 = _numbers[end];
  140.  
  141. if(comper1>comper2)
  142. printf("%d",comper1);
  143. else
  144. printf("%d",comper2);
  145. }
  146.  
  147. void Sheet_week2_6(){
  148. int _number;
  149. printf("Enter number: ");
  150. scanf("%d", &_number);
  151.  
  152. for (int table = 1 ; table <= 12 ; table++)
  153. printf("%d * %d = %d\n",_number,table,_number*table);
  154. }
  155.  
  156. int main(){
  157.  
  158. //Sheet_week1_1();
  159. //Sheet_week1_2();
  160. //Sheet_week1_3();
  161. //Sheet_week1_4();
  162. //Sheet_week1_5();
  163. //Sheet_week1_6();
  164.  
  165. //Sheet_week2_1();
  166. //Sheet_week2_2();
  167. //Sheet_week2_3();
  168. //Sheet_week2_4();
  169. //Sheet_week2_5();
  170. //Sheet_week2_6();
  171. return 0;
  172. }
  173.  
  174.  
Success #stdin #stdout 0.01s 5288KB
stdin
Thx
stdout
Standard output is empty