fork download
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int n;
  5. printf("Size of String: ");
  6. scanf("%d", &n);
  7. printf("Input: ");
  8. char str[n];
  9. for(int i=0; i<n; i++)
  10. {
  11. scanf("%c", &str[i]);
  12. }
  13. printf("Output: ");
  14. for(int i=0; i<n; i++)
  15. {
  16. printf("%c", str[i]);
  17. }
  18. }
  19.  
Success #stdin #stdout 0s 5280KB
stdin
5
abcdefg
stdout
Size of String: Input: Output: abcde