tres con el mismo error
Publicado por cesar (22 intervenciones) el 26/12/2017 19:20:41
Digo asi por que el 1 cuyo enunciado es copiar numeros del 1 al 100 como el 2 dan error solo aparece un 1 al ejecutarse y no del 1 al 100
el tercero si nada se ve en pantalla veamos
Este es el 1
el 2
y el 3
el tercero si nada se ve en pantalla veamos
Este es el 1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ciclo_whilev8
{
class Program
{
static void Main(string[] args)
{
int x = 1;
while ( x < 100)
{
Console.WriteLine(x);
x = x ++ ;
Console.ReadKey();
}
}
}
}
el 2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//numeros del 1 al n numero
namespace ciclo_whilev8
{
class Program
{
static void Main(string[] args)
{
int x = 1 , n ;
string entrada;
Console.WriteLine("digita el numero");
entrada = Console.ReadLine();
Console.WriteLine();
n = int.Parse(entrada);
while ( x < n)
{
Console.WriteLine(x);
x = x ++ ;
Console.ReadKey();
}
}
}
}
y el 3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//numeros del 1 al n numero
namespace ciclo_whilev8
{
class Program
{
static void Main(string[] args)
{
int x = 1 , suma = 0, promedio ;
string entrada;
while (x < n)
{
Console.WriteLine("digita el numero "), +x;
entrada = Console.ReadLine();
Console.WriteLine();
suma += int.Parse(entrada);
x = x + 1 ;
Console.ReadKey();
}
promedio = suma +10;
Console.WriteLine("la suma es ", "+suma+", "el promedio es", promedio,;
}
}
}
Valora esta pregunta


0