martes, 5 de abril de 2011

C++ STRUCTURAS EJEMPLO1

#include <stdio.h>
#include <conio.h>
#include <iostream>
using namespace std;
int main()
{
struct empleado
{
char nombre[64];
int ne;
float salario;
char tel[30];
int no;
}tra;
strcpy(tra.nombre,"RODRIGO VILLANUEVA");//COPIA EL NOMBRE A NOMBRE
tra.ne=12;
tra.salario=25000;
strcpy(tra.tel,"76876");
tra.no=13;
cout<<"EMPLEADO: "<<tra.nombre<<"\n";
cout<<"NUMERO DE EMPLEADO: "<<tra.ne<<"\n";
cout<<"SALARIO: "<<tra.salario<<"\n";
cout<<"TELEFONO: "<<tra.tel<<"\n";
cout<<"NUMERo DE OFICINA: "<<tra.no<<"\n";
getch();
}

No hay comentarios:

Publicar un comentario