Red de conocimiento informático - Problemas con los teléfonos móviles - Por favor programe

Por favor programe

1.

# incluir & ltstdio.h & gt

main()

{

int x, y;

printf("Por favor ingrese x:");

scanf("%d ", & ampx);

/*Las siguientes tres oraciones se pueden reemplazar con esto oración :y = (x

si(x & lt; 0)y = x-1;

de lo contrario si(x == 0)y = 0;

else y = 1;

printf(" valor de y=%d ",y);

getch();

}

2.

# incluir & ltstdio.h & gt

main()

{

int h, Yo , s;

s = 560

h = s/60;

i = s % 60

printf("% d Minutos iguales a %d horas %d minutos", s, h, I);

getch();

}

3.

# incluir & ltstdio.h & gt

main()

{

int a, b, c, d, max, temp

max = 0;

temp = 0;

printf("Ingrese los valores de a, b, c, d:\ n ") ;

scanf("%d%d%d%d ", & amp one, & ampb & amp; c, & ampd);

/*Las siguientes seis líneas pueden ser reemplazado por esta línea: max =(a>b?a:b)>(c>d?c:d)? (a>b?answer:b):(c>d?c:d);*/

si (a & gt= b)max = a;

si no max = b;

si (c & gt;= d)temp = c;

else max = b;

si (c & gt;= d)temp = c;

p>

else temp = d;

if(max & lt;temp)max = temp;

printf("El valor máximo de a, b, c, d es %d ", max

getch();

}

cuatro

# incluir & ltstdio.h & gt

main()

{

char c;

int carácter=0, número=0, espacio=0, otros = 0 ;

/*

Entrada

abcdefg 1234 <& gt& lt& gt

Salida

Carácter =7

Número=4

Espacio=3

Otros=5

*/

Hacer

{

c = getchar ();

if(c & gt;= ' a ' & amp& ampc & lt= ' z ' | | c & gt= ' A ' & amp& ampc & lt='Z ') carácter++;

else if(c & gt;= ' 0 ' & amp& ampc & lt='9 ')número++ ;

else if(c== ' ')espacio++;

otros otros++;

}

Y (c! = '\ n ');

printf(" carácter = % d \ n entumecido

er = % d \ n espacio = % d \ n otros = % d \ n ", caracteres, números, espacios, otros);

getch();

}

5.

# incluir & ltstdio.h & gt

main()

{

printf(" * * * * * * * * * * * \n ");

printf(" * * * * * * * * * * * \n ");

printf (" * * * * * * * * * * * \ n ");

printf(" * * * * * * * * * * \ n "); >getch();

}

6.

# incluir & ltstdio.h & gt

main()

{

int I = 0

int j = 0

for(;i<5;i++)

{

for(j = 5-I; j & gt0;j -)

printf(" ");

printf("@" );

for(j = 0;j<i;j++)

printf("@ @");

printf(" \ n " );

}

getch();

}

7.

# include & ltstdio h & gt

Coma flotante a (coma flotante n)

{

Coma flotante;

Si (n & lt1)

return-1;

si no(n==1)

an = 1;

Otro

an = a( n-1)+(2 * n-1)/(n * n);

Devolver uno;

}

Principal ()

{

N flotante;

printf("Ingrese n:");

scanf("%f ",&n);

printf("a(n)=%f ",a(n));

getch();

}

8.

# incluir & ltstdio.h & gt

Entero a

{

int i, an = 0;

for(I = 1;i<= n;i++)

{

an+= I;

}

Devuelve a;

}

main()

{

int n;

p>

printf ("Ingrese n:");

scanf("%d ", & ampn);

printf("a(n)=%d ", a(n)

getch();

}

9.

# incluir & ltstdio.h & gt

Entero a

{

int i, an = 0

for(I = 1; i<= n ;i++)

{

if(i%2==1)

an+= 2 * I-1;

Otros

an -= 2 * I-1;

}

Devuelve uno

}

main()

{

int n;

printf("Ingrese n:");

scanf( "%d ",&n);

printf("a(n)=%d ",a(n));

getch();

}

10.

# incluir & ltstdio.h & gt

main()

{

int a[3][4]={{1,2,3,4},{9,8,7,6},{-10,10,-5,2}};

int i, j, máx, maxi, maxj

max = 0;

maxi = 0

maxj = 0; >for(I = 0;i<3;i++)

for(j = 0;j <3;j++)

{

if( max & lt; a[i][j])

{

max = a[I][j];

maxi = I;

p>

maxj = j;

}

}

printf("El valor máximo del array es a[%d][%d]= %d ", maxi, maxj, max);

getch();

}

11.

# incluir & ltstdio .h & gt

main()

{

int i, n, num=0, suma = 0

int; a[100];

printf("Ingrese el número de estudiantes n = ");

scanf("%d ", & ampn); >for (I = 0;I<n;i++)

{

printf("Ingrese la puntuación del estudiante número %d", I+1);

scanf("%d ", & ampa[I]);

if(a[I]& gt;90)num++;

suma+= a[I] ;

}

printf("La suma de las puntuaciones es %d \nEl número de estudiantes con puntuaciones superiores a 90 es %d ", sum, num); p>getch( );

}

12.

# incluir & ltstdio.h & gt

main()

{

int f, g, x;

printf("Ingrese el valor de x:"); %d ",& ampx);

g = 2 * x+1;

f =(g+1)/2;

printf(" G(x)= %d\n ",G);

printf("F(G(x))=%d\n ",F);

getch( );

}