LegoDrifter

Untitled

Jun 14th, 2020
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.51 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void main()
  5. {
  6.     char str[100]; /* Declares a string of size 100 */
  7.     int i= 0;
  8.  
  9.        printf("\n\nSeparate the individual characters from a string :\n");
  10.        printf("------------------------------------------------------\n");
  11.        printf("Input the string : ");
  12.        fgets(str, sizeof str, stdin);
  13.        printf("The characters of the string are : \n");
  14.     while(str[i]!='\0')
  15.     {
  16.        printf("%c  ", str[i]);
  17.        i++;
  18.     }
  19.     printf("\n");
  20. }
Advertisement
Add Comment
Please, Sign In to add comment