219,302pages on
this wiki
Add New Page
Discuss this page0 Share
Programa:         Unidad4Ejercicio07.cpp
Fecha:            24/11/2006
Descripción:      Muestra la longitud de una cadena.

#include <iostream>
#include <conio>
#include <stdlib>
#include <ctype>
using namespace std;

int longitud(char c[]);

void main()
      int i;
      char nombre[20];

      cout << "Introduzca su nombre ";
      cin >> nombre;

      cout << "La longitud de la cadena es = " << longitud(nombre) << endl;


int longitud(char c[])
      int i;
      for(i = 0; c[i] != '\0'; i++);
      return i;

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Also on Fandom

Random wikia