0% found this document useful (0 votes)
4 views

5 Ta Flowgorithm

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

5 Ta Flowgorithm

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Dastur kodi: Natija:

using System; Kiruvchi qiymat: Chiquvchi qiymat:


Input Output:
public class MyProgram 3 2 3.6
{
public static void Main(string[] args)
{
double x, n, s, power, factorial, i, j;

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:

using System; Kiruvchi qiymat: Chiquvchi qiymat:


public class MyProgram Input Output:
{
public static void Main(string[] args) 2342 Y: 1
{
int a, b, c, x, h, y;

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:

using System; Kiruvchi qiymat: Chiquvchi qiymat:


Input Output:
public class MyProgram
{ 5464 6.5456458575...
public static void Main(string[] args)
{
int x, y, c, d, a, i, j;
double s, p, sP;

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:

using System; Kiruvchi qiymat: Chiquvchi qiymat:


public class MyProgram Input Output:
{
public static void Main(string[] args) 3 2 0.203
{
int n, x, i;
double s;

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:

using System; Kiruvchi qiymat: Chiquvchi qiymat:


Input Output:
public class MyProgram
{ 123 Raqamlar ketma-
public static void Main(string[] args) ket o‘suvchi yoki
{ kamayuvchi
int son, yuzlik, onlik, birlik; tartibda

son = (int) inputValue();


yuzlik = (int) ((double) son / 100);
onlik = (double) son / 10 % 10;
birlik = son % 10;
if (yuzlik < onlik && onlik < birlik || yuzlik > onlik && onlik >
birlik)
{
Console.WriteLine("Raqamlar ketma-ket o‘suvchi yoki
kamayuvchi tartibda");
}
else
{
Console.WriteLine("Raqamlar ketma-ket o‘suvchi yoki
kamayuvchi tartibda emas");
}
}

// .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;
}
}

You might also like