fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. char var[50] = " Write Once Run Everywere ";
  5. int cont = 0;
  6. for (int i = 0; i < 50; i++) {
  7. if (var[i] == ' ') {
  8. cont++;
  9. }
  10. }
  11. printf("Existem %d espaços em branco", cont);
  12. }
  13.  
  14. //http://pt.stackoverflow.com/q/185005/101
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
Existem 5 espaços em branco