5 Ta Flowgorithm
5 Ta Flowgorithm
n = inputValue();
x = inputValue();
s = 0;
for (i = 0; i <= n - 1; i++)
{
power = 2 * i + 1;
factorial = 1;
for (j = 1; j <= power; j++)
{
factorial = factorial * j;
}
s = s + Math.Pow(x, power) / factorial;
}
Console.WriteLine(s);
}
// .NET can only read single characters or entire lines from the
// console. The following function safely reads a double value.
private static double inputValue()
{
double result;
while (!double.TryParse(Console.ReadLine(), out result));
return result;
}
}
Dastur kodi: Natija:
h = 2;
Console.WriteLine("a: ");
a = (int) inputValue();
Console.WriteLine("b: ");
b = (int) inputValue();
Console.WriteLine("c: ");
c = (int) inputValue();
Console.WriteLine("x: ");
x = (int) inputValue();
y = (int) ((Math.Pow(a, b) + Math.Pow(b, x) + Math.Pow(c, a))
/ (2 * Math.Pow(x, 2) + 3 * Math.Pow(a, x)));
Console.WriteLine("y: " + y);
}
// .NET can only read single characters or entire lines from the
// console. The following function safely reads a double value.
private static double inputValue()
{
double result;
while (!double.TryParse(Console.ReadLine(), out result));
return result;
}
}
Dastur kodi: Natija:
s = 0;
Console.WriteLine("O'zgaruvchilarni kiriting: (1 ≤ x, y, c, d ≤
10)");
Console.WriteLine("x: ");
x = (int) inputValue();
Console.WriteLine("y: ");
y = (int) inputValue();
Console.WriteLine("c: ");
c = (int) inputValue();
Console.WriteLine("d: ");
d = (int) inputValue();
for (a = 1; a <= x; a++)
{
s = s + (a * x + 4) / (Math.Sqrt(a) + Math.Log(6));
}
p = 1;
for (a = 1; a <= y; a++)
{
p = p * (Math.Pow(a, 2) + 6) / Math.Sin(a * x);
}
sP = 1;
for (i = 1; i <= c; i++)
{
for (j = 1; j <= d; j++)
{
sP = sP * (i * j + y * x) / Math.Sqrt(Math.Pow(j * x + y, i));
}
}
Console.WriteLine("SP: " + sP);
}
// .NET can only read single characters or entire lines from the
// console. The following function safely reads a double value.
private static double inputValue()
{
double result;
while (!double.TryParse(Console.ReadLine(), out result));
return result;
}
}
Dastur kodi: Natija:
s = 0;
Console.WriteLine("O'zgaruvchilarni kiriting: (0≤n,x≤9)");
Console.WriteLine("n: ");
n = (int) inputValue();
Console.WriteLine("x: ");
x = (int) inputValue();
for (i = 1; i <= n; i++)
{
s = s + Math.Pow(-1, i - 1) * 1 / Math.Pow(x, 2 * i);
}
Console.WriteLine("S: " + s);
}
// .NET can only read single characters or entire lines from the
// console. The following function safely reads a double value.
private static double inputValue()
{
double result;
while (!double.TryParse(Console.ReadLine(), out result));
return result;
}
}
Dastur kodi: Natija:
// .NET can only read single characters or entire lines from the
// console. The following function safely reads a double value.
private static double inputValue()
{
double result;
while (!double.TryParse(Console.ReadLine(), out result));
return result;
}
}