Que: Write a program to demonstrate the Library function for the string.
Code:
#include <stdio.h>
void myfunction(char str[]);
int main()
{
char str[50];
printf("\n Enter your name : ");
gets(str);
myfunction(str); // Passing string to a function.
return 0;
}
void myfunction(char str[])
{
printf("\n Output using my function: ");
puts(str);
}
Output:
No comments:
Post a Comment