17 lines
326 B
C
17 lines
326 B
C
|
#include <stdio.h>
|
||
|
void displayString(char str[]);
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
char str[50];
|
||
|
printf("Enter string: ");
|
||
|
fgets(str, sizeof(str), stdin);
|
||
|
displayString(str); /* Passing string to a function. */
|
||
|
return 0;
|
||
|
}
|
||
|
void displayString(char str[])
|
||
|
{
|
||
|
printf("String Output: ");
|
||
|
puts(str);
|
||
|
}
|