PAGINA 1 (LENGUAJE "C" )




HOLA CETIS


#include <stdio.h>
#include <conio.h>
main()
{
clrscr();
gotoxy(35,10); printf("hola cetis");
getch();
}




HOLA COMO ESTAS

#include<stdio.h>
#include<conio.h>
main()
{
clrscr();


printf("\tque tal\n\n");
printf("como estas\n\n");
printf("yo bien gracias\n\n");
gotoxy(30,10);printf("rio blanco, ver.");
gotoxy(20,20);printf("cordova");
gotoxy(30,12);printf("HECTOR TEHUACATL ROSALES");

getch();
}








PROGRAMA SUMA

#include <stdio.h>
#include <conio.h>
main()
{ int num1, num2, suma;
clrscr();
gotoxy<30,12>printf("dar un numero|");
scanf("%d", & num1);
gotoxy<20,13>printf("dar otro numero|");
scanf("%d",& num2);
suma = num1 + num2;

gotoxy<20,30>printf("la suma de %d mas %d es %d",num1,num2,suma);
getch();
}



MAYOR



#include<conio.h>
#include<stdio.h>
main()
{float a,b,c;
clrscr();
printf("Dar un Primer Numero:");
scanf("%f",&a);
printf("Dar un Segundo Numero:");
scanf("%f",&b);
printf("Dar un Tercer Numero:");
scanf("%f",&c);
if (a>b) && (a>c)
 { printf("El Numero %f es el mayor de los 3",a); getch();}
else if (b>a) && (b>c)
        { printf("El Numero %f es el mayor de los 3",b); getch();}
     else if (c>a) && (c>b)
              { printf("El Numero %f es el mayor de los 3",c); getch();}
          else {printf("Los 3 numeros son IGUALES"); getch();}
}

v=d/t;
printf("la velocidad es %4.2f",v);
getch( );
}





PROMEDIO CON CICLO FOR


#include <stdio.h>
#include <conio.h>
main()
{char nom[25];
float c1,c2,c3,prom;
int x;
for (x=1; x<=5;x++)
{clrscr ();
 printf("Alumno No.%d",x);
printf("dar un nombre");scanf("%s");
printf("dar 3 calificaciones:");scanf("%f %f %f",&c1,&c2,&c3);
prom=(c1+c2+c3)/3;
if (prom>=6){printf("%s el alumno  esta Aprobado con %f", nom,prom);
getch();
}
else{printf("%s el alumno  esta Reprobado con %f", nom,prom);
getch();
}
}
}





PROMEDIO




#include <stdio.h>
#include <conio.h>
main()
{
char nom [25];
float c1,c2,c3,prom;
printf("dar un nombre|");
scanf("%s",& nom);
printf("dar una calificacion");
scanf("%f",& c1);
printf("dar una segunda calificacion");
scanf("%f",& c2);
printf("dar una tercera calificacion");
scanf("%f",& c3);
prom=(c1+c2+c3)/3;
printf("el alumno %s tiene un promedio de %f", nom,prom);
getch();
}





CONTROLADOR DE LA NOMINA EN UNA EMPRESA




#include<stdio.h>
#include<conio.h>
main()
{
char cve[20], pues[15],nom[15];
int hrs;
float pagoxhrs,comi,tp,td,isr,imss,an,sn;
clrscr();
gotoxy(5,5);printf("dar clave|");scanf("%s",&cve);
gotoxy(5,7);printf("dar nombre|");scanf("%s",&nom);
gotoxy(5,9);printf("dar puesto|");scanf("%s",&pues);
gotoxy(5,11);printf("dar horas laboradas|");scanf("%d",&hrs);
gotoxy(5,13);printf("dar pago por hora|");scanf("%f",&pagoxhrs);
gotoxy(5,15);printf("dar comision|");scanf("%f",&comi);
tp=hrs*pagoxhrs+comi;
gotoxy(5,17);printf("%s, tiene de percepcciones de %f",nom,tp);
isr=tp*.04;
imss=tp*.06;
gotoxy(5,19);printf("dar anticipo|");scanf("%f",&an);
td=isr+imss+an;
sn=tp-td;
gotoxy(5,21);printf("tiene de deducciones de %f y su sueldo neto es %f",td,sn);
getch();






CONTROLADOR DE LA NOMINA EN UNA EMPRESA ( CICLO FOR)



#include<stdio.h>
#include<conio.h>
main()
{
char cve[20], pues[15],nom[15];
int hrs;
float pagoxhrs,comi,tp,td,isr,imss,an,sn;
clrscr();
int x;
for (x=1; x<=3 ;x++)
{
gotoxy(5,5);printf("dar clave|");scanf("%s",&cve);
gotoxy(5,7);printf("dar nombre|");scanf("%s",&nom);
gotoxy(5,9);printf("dar puesto|");scanf("%s",&pues);
gotoxy(5,11);printf("dar horas laboradas|");scanf("%d",&hrs);
gotoxy(5,13);printf("dar pago por hora|");scanf("%f",&pagoxhrs);
gotoxy(5,15);printf("dar comision|");scanf("%f",&comi);
tp=hrs*pagoxhrs+comi;
gotoxy(5,17);printf("%s, tiene de percepcciones de %f",nom,tp);
isr=tp*.04;
imss=tp*.06;
gotoxy(5,19);printf("dar anticipo|");scanf("%f",&an);
td=isr+imss+an;
sn=tp-td;
gotoxy(5,21);printf("tiene de deducciones de %f y su sueldo neto es %f",td,sn);
getch();
}
}






PROGRAMA QUE MULTIPLIQUE 2 NUMEROS CUALQUIERA E IMPRIMA EL RESULTADO SIEMPRE Y CUANDO ESTE SEA MAYOR A 500


#include<stdio.h>
#include<conio.h>
main()
{int no, num1,num2,multiplicacion;
clrscr();
gotoxy<30,12>printf("dar un numero");
scanf("%d",&num1);
gotoxy<20,30>printf("dar otro numero");
scanf("%d",& num2);
multiplicacion=num1*num2;
if(no>=500){printf("la multiplicacion de %d * %d es %d",num1,num2,multiplicacion);
getch();
}
else{printf("la multiplicacion de %d * %d es %d",num1,num2,multiplicacion);
getch();
}
}




PROGRAMA QUE LEEA N NUMEROS Y QUE HAGA LA SUMA DE ELLOS .DEBE TERMINA CUANDO UN NUMERO SEA IGUAL A 0 ,IMPIMIENDO LA SUMA DE TOTAL DE NUMEROS


#include<stdio.h>
#include<conio.h>
main()
{int num1,num2,suma;
clrscr();
gotoxy<30,12>printf("dar un numero");
scanf("%d", & num1);
gotoxy<20,13>printf("dar otro numero");
scanf("%d",& num2);
suma= num1 + num2;
if(num1%2!=0)
gotoxy<20,30>printf("la suma de %d mas %d es %d",num1,num2,suma);
getch();
}


PROGRAMA QUE LEA N NUMEROS Y QUE IMPRIMA CUANTOS NUMEOS LEYO.DEBE TERMINAR CUANDO EL NUMERO SEA IGUAL A 99



#include <conio.h>
#include <stdio.h>
#include <iostream>
int main () {

int c=1,a,res=1;
printf ("dar tus numeros: \n");
while(c=!0){
scanf ("%d",&a);
if (a==99){
printf("pulsaste el numero 99");
printf("\nTERMINAR EL PROGRAMA");
printf("\nel resultado de los digitados son: %d",res);
c==0;}
else{
    res=1+res;
c==1;    }}
printf("\n\n\n");
system ("pause");
return (0);
}

PROGRAMA QUE LEA NOMBRE Y EDAD DE UNA PERSONA . SI LA EDAD ES MAYOR A 18 AÑOS IMPRIMIR "MENOR DE EDAD" EN CASO CONTRAIO "MAYOR DE EDAD"


#include<stdio.h>
#include<conio.h>
main()
{
int nom,edad;
clrscr();
printf("dar un edad");      scanf("%f",&nom);
printf("dar la nombre");    scanf("%f",&edad);
{
if(edad>=18){printf("la persona es menor de edad con %d");
getch();
}
else
{
printf("la persona es mayor de edad con %d");
getch();
}
}
}


PROGRAMA QUE OBTENGA EL FACTORIAL



#include<stdio.h>
#include<conio.h>
main()
{
int i,numero,factorial=1;
printf("\nEscribe un numero para calcula el factorial");
scanf("%d",&numero);
for(i=numero; i>1; --i)
factorial *=i;
printf("\n%d!=%d\n",numero,factorial);
getch();
}












PROGRAMA QUE LEEA NOMBRE Y 4 CALIFICACIONES DEL ALUMNO.DEBE IMPRIMIR AL FINAL NOMBRE Y PROMEDIO CORESPONDIENTES INDICANDO SI APRUEBA O NO EL ALUMNO




#include <stdio.h>
#include <conio.h>
main()
{char nom[25];
float c1,c2,c3,c4,prom;
int x;
for (x=1; x<=5; x++)
{clrscr ();
printf("Alumno No.%d",x);
printf("dar un  nombre");scanf("%s");
printf("dar 4 calificaciones");scanf("%f %f %f %f",&c1,&c2,&c3,&c4);
prom=(c1+c2+c3+c4)/4;
if(prom>=6){printf("%s el alumno esta Aprobado con %f", nom,prom);
getch();
}
else{printf("%s el alumno esta Reprobado con %f", nom,prom);
getch();
}
}




PROGRAMA QUE LEA 2 NUMEROS Y SI ESTOS SON PARES QUE LOS MULTIPLIQUE PERO SI SON IMPARES QUE LOS SUME,IMPRIMIENDO  RESULTADO CORRESPONDIENTE


#include<stdio.h>
#include<conio.h>
main()
{
float num,num1,num2;
int mul,suma;
clrscr();
{
printf("dar un numero");
scanf("%f",&num1);
printf("dar otro numero");
scanf("%f",&num2);
if(num/2==mul,suma
)
{
printf("la suma es %f",num,mul);
}

else
{printf("la multiplicacion es %f",num,suma);
getch();
}
}
}




















2 comentarios: