Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void spacja(char string[])
  5. {
  6.     char temp[100];
  7.     int i;
  8.     int j=0;
  9.     for(i=0; string[i]!='\0'; i++)
  10.     {
  11.         if(string[i]!=' ')
  12.         {
  13.             temp[j]=string[i];
  14.             j++;
  15.            
  16.         }
  17.     }
  18.  
  19.     for(i=0; temp[i]!='\0';i++)
  20.     {
  21.         string[i]=temp[i];
  22.     }
  23.     string[i+1]='\0';
  24. }
  25.  
  26. int main()
  27. {
  28.     printf("Hello world!\n");
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement