A program to explain how to pass a string to a function
C Programming Language 084
- Write a program to explain how to pass a string to a function
Program
#include <stdio.h>
void strings(char s1[]);
void main()
{
char str1[30];
printf("Enter string: ");
gets(str1);
strings(str1);
printf("\n");
}
void strings(char s1[])
{
puts(s1);
}
Result
Enter string: hello
hello
Last Updated on
Comments