Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created February 1, 2021 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/7406a1e00c69c36ab0de1c05e0f298bb to your computer and use it in GitHub Desktop.
Save parzibyte/7406a1e00c69c36ab0de1c05e0f298bb to your computer and use it in GitHub Desktop.
/*
https://parzibyte.me/blog
*/
#include <stdio.h>
#include <ctype.h>
int main()
{
char nombre[] = "parzibyte";
printf("Antes de intercalar: %s\n", nombre);
int i = 0;
for (i = 0; nombre[i] != '\0'; i++)
{
if (i % 2 == 0)
{
nombre[i] = toupper(nombre[i]);
}
else
{
nombre[i] = tolower(nombre[i]);
}
}
printf("Después de intercalar: %s\n", nombre);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment