Program to print String Elements using Pointer

#include<stdio.h> #include<conio.h>  main() { char name [ ] = “Degree College”; char * ptr; ptr=name;    //stori...



#include<stdio.h>
#include<conio.h> 
main()
{
char name [ ] = “Degree College”;
char *ptr;
ptr=name;    //storing the base address of 0th  element of string
while (*ptr!=’\0’)
{
printf(“%c”, *ptr);
ptr++;
}
getch();
}

Related

C Programs 7583973364735323846

Post a Comment

emo-but-icon

item