Guest User

Untitled

a guest
Dec 10th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <ctype.h>
  3. #include <string.h>
  4. #include <stdlib.h>
  5.  
  6.  
  7. int main () {
  8. char vetor[100],aux;
  9. int n,i;
  10. printf("Digite a frase: ");
  11. gets(vetor);
  12. n = strlen(vetor);
  13.  
  14. for(i=0;i<n;i++){
  15. aux = vetor[i];
  16.     if (i%2 == 0){
  17.         vetor[i] = (toupper(aux));}
  18.     else {
  19.         vetor[i] = (tolower(aux));}
  20. }
  21. printf("Frase nova: %s \n\n", vetor);
  22.  
  23. return 0;
  24. }
Add Comment
Please, Sign In to add comment