Restart: Console. Write("\n n="); son = int. Parse


Download 102.5 Kb.
Sana10.02.2023
Hajmi102.5 Kb.
#1184564
Bog'liq
12-Amaliy mashg\'ulot



// 12-amaliy 10-variant
int son;
restart:
Console.Write("\n n=");
son = int.Parse(Console.ReadLine());
int n = son;
int s = 0;
while (son > 0)
{
s = s + son % 10;
son /= 10;
}
Console.Write("\n"+n+" sonining raqamlari yig'indisi "+s+" ga teng \n");
goto restart;
Download 102.5 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling