Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- משימה 1 א
- for (int i = 1; i<=100;i++)
- {
- Console.Write("amit");
- }
- משימה 1 ב
- Console.ForegroundColor = ConsoleColor.Blue;
- for (int i = 1; i<=100;i++)
- {
- Console.Write("amit");
- }
- משימה 1 ג
- Console.ForegroundColor = ConsoleColor.Blue;
- for (int i = 1; i<=100;i++)
- {
- Console.Write("amit ");
- }
- משימה 1 ד
- int x;
- Console.WriteLine("enter the number of times your name will apper");
- x=int.Parse(Console.ReadLine());
- Console.ForegroundColor = ConsoleColor.Blue;
- for (int i = 1; i<=x;i++)
- {
- Console.Write("amit");
- }
- משימה 2
- for (int i = 30; i<=55;i=+3)
- {
- Console.WriteLine(i);
- }
- משימה 3
- int x, y;
- Console.WriteLine("enter first number");
- y = int.Parse(Console.ReadLine());
- Console.WriteLine("enter 2nd number");
- x = int.Parse(Console.ReadLine());
- if (x<y)
- for (int i=x; i<=y; i++)
- {
- Console.WriteLine(i);
- }
- else
- for (int i = y; i <=x; i++)
- {
- Console.WriteLine(i);
- }
- משימה 4
- int x;
- Console.WriteLine("enter num");
- x = int.Parse(Console.ReadLine());
- for (int i = x; i <= 60; i = i + x)
- {
- Console.WriteLine(i);
- }
- משימה 5
- int x;
- for (int i = 1; 1 <= 7; i++)
- {
- Console.WriteLine("enter num");
- x = int.Parse(Console.ReadLine());
- if (x > 0)
- Console.WriteLine("possitive");
- else
- Console.WriteLine("negative");
- }
- משימה 6
- int x, y, count = 0;
- for (int i=1;i<=8;i++)
- { Console.WriteLine("enter num");
- x = int.Parse(Console.ReadLine());
- y = (x % 10);
- Console.WriteLine("sifrat a ahadot hi:");
- Console.WriteLine(y);
- count = (count + y);
- }
- Console.WriteLine(count);
- משימה 7
- int x;
- for (int i = 1; i <= 7; i++)
- {
- Console.WriteLine("enter num");
- x = int.Parse(Console.ReadLine());
- if ((x >= 100) || (x <= -100))
- Console.WriteLine("misapar baal 3 sfarot o yoter");
- else
- Console.WriteLine("mispar baal pahot me 3 sfarot");
- }
- משימה 8
- int x , y ,z,n=0;
- for (int i =1;i<=5;i++)
- {
- Console.WriteLine("enter num");
- x = int.Parse(Console.ReadLine());
- y = x % 10;
- z = (x/10);
- if ((x > 9) && (x < 100) || (x<-9)&&(x>-100))
- {
- Console.WriteLine("shum a sfarot:");
- Console.WriteLine(y+z);
- if (y + z > n)
- n = y + z;
- }
- else
- Console.WriteLine("error");
- }
- Console.WriteLine("shum as sfarot as gavoa be yoter hu:");
- Console.WriteLine(n);
- משימה 9
- int num,n,count=0;
- for (int i = 1; i <= 10; i++)
- {
- Console.WriteLine("enter num");
- num = int.Parse(Console.ReadLine());
- n = (num % 7);
- if (n == 0)
- count = (count + 1);
- }
- if (count > 0)
- Console.WriteLine("yesh lefahot mispar ehad she mithalek be 7");
- משימה 10
- int tzion, avg1=0,avg2=0;
- for (int i = 1; i <= 12; i++)
- {
- Console.WriteLine("enter tzion");
- tzion = int.Parse(Console.ReadLine());
- avg1 = (avg1 + tzion);
- }
- Console.WriteLine("memutza shlish rishon:");
- Console.WriteLine(avg1/12);
- for (int i = 1; i <= 12; i++)
- {
- Console.WriteLine("enter tzion");
- tzion = int.Parse(Console.ReadLine());
- avg2 = (avg2 + tzion);
- }
- Console.WriteLine("memutza shlish sheni:");
- Console.WriteLine(avg2/12);
- if (avg1 == avg2)
- Console.WriteLine("memutza lo hishtana");
- else
- if (avg1 > avg2)
- Console.WriteLine("nesiga ba memutza");
- else
- Console.WriteLine("shipur ba memutza");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement