Enter any string and display it in a vertical order Using Pointer in C Language


void main()
{
 char na[10],*p;
 clrscr();

 printf("enter string:");
 scanf("%s",na);

 p=&na[0];
 while(*p!='\0')
 {
  printf("\n%c",*p);
  p++;
 }
 getch();
}


Output:
Enter String :-> Coding

C
o
d
i
n
g




Enter any string and display it in a vertical order Using Pointer in C Language Enter any string and display it in a vertical order Using Pointer in C Language Reviewed by Unknown on 8:07:00 PM Rating: 5

No comments:

Powered by Blogger.