menu bar

Thursday, 14 April 2016

Translasi 6.11. Mencoba upcase




#include <iostream.h>
#include <string.h>
void ubah_ke_huruf_besar(char *s)
{    int i;
  for (; *s != '\0'; s++)
  *s = toupper(*s);
}

main()
{    char *kata="Algoritma dan Pemrograman";
  ubah_ke_huruf_besar(kata);
  cout <<  "%s\n",kata);
  cout <<  "Panjang kata = %d",strlen(kata));
  return 0;
}

No comments:

Post a Comment