1
[Escriba aquí] [Escriba aquí] Ejercicio cadenas rbm #include <iostream> //lectura de un caracter con cin.get using namespace std; int main() // entrada3.cpp { char letra; // variable caracter cout<<"Ingrese una letra del alafabeto : "; cin.get(letra); // leer caracter cout<<"\nUsted ingreso la letra : "<<letra<<endl; cout<<endl; system("PAUSE"); return 0; } #include <iostream> //lectura de un un array de caracteres con cin.getline using namespace std; int main() // entrada4.cpp { char nombre(40); // array de caracteres cout<<"Ingrese sus nombres y apellidos : "; cin.getline(nombre,40); // leer caracter cout<<endl<<"hola , "<<nombre<<endl;endl; system("PAUSE"); return 0; }

Lectura Array Caracteres

  • Upload
    luciana

  • View
    215

  • Download
    0

Embed Size (px)

DESCRIPTION

algoritmos

Citation preview

Page 1: Lectura Array Caracteres

[Escriba aquí] [Escriba aquí] Ejercicio cadenas rbm

#include <iostream>

//lectura de un caracter con cin.get

using namespace std;

int main() // entrada3.cpp

{

char letra; // variable caracter

cout<<"Ingrese una letra del alafabeto : ";

cin.get(letra); // leer caracter

cout<<"\nUsted ingreso la letra : "<<letra<<endl;

cout<<endl;

system("PAUSE");

return 0;

}

#include <iostream>

//lectura de un un array de caracteres con cin.getline

using namespace std;

int main() // entrada4.cpp

{

char nombre(40); // array de caracteres

cout<<"Ingrese sus nombres y apellidos : ";

cin.getline(nombre,40); // leer caracter

cout<<endl<<"hola , "<<nombre<<endl;endl;

system("PAUSE");

return 0;

}