Skip to content

Instantly share code, notes, and snippets.

@ciceroverneck
Created May 13, 2012 15:51
Show Gist options
  • Save ciceroverneck/2689008 to your computer and use it in GitHub Desktop.
Save ciceroverneck/2689008 to your computer and use it in GitHub Desktop.
:P
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void contaEspaco(char s[], int tam){
int i=0;
while(i<tam){
if(s[i]!=' ')
printf("%c",s[i] )
i++;
}
return espacos;
}
int main(){
int espaco, tamanho;
char s[20];
printf("Digite uma string:");
gets(s);
tamanho=strlen(s);
contaEspaco(s, tamanho);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment