157. Design a function to print given string character by character.
#include<stdio.h>
char
s[10];
void
print_string(const char *);
void
main()
{
printf("Enter a string : ");
scanf("%s",s);
print_string(s);
//print_string("embedded");
printf(“\n”);
}
void
print_string(const char *p)
{
int i;
for(i=0;p[i];p++)
{
printf("%c",p[i]);
}
}
Comments
Post a Comment