17 lines
319 B
C
17 lines
319 B
C
// Prints string char by char, using strlen, remembering string's length
|
|
|
|
#include <cs50.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
int main(void)
|
|
{
|
|
string s = get_string("Input: ");
|
|
printf("Output: ");
|
|
for (int i = 0, n = strlen(s); i < n; i++)
|
|
{
|
|
printf("%c", s[i]);
|
|
}
|
|
printf("\n");
|
|
}
|