Advertisement
apl-mhd

Pointer

Feb 20th, 2016
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int n, count =0;
  7. char word1[] = "amar sonar bangla ami tumai valobashi";
  8.  
  9. // int stringSize = sizeof(word1);
  10. for(n = 0; word1[n] != '\0' ; n++){
  11.  
  12. if(word1[n] == ' '){
  13.  
  14. count++;
  15. }
  16. }
  17.  
  18. printf("%d", count+1);
  19.  
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement