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

Write A Program for calculating LCM & GCD

# include<stdio.h> #include<conio.h> void main ( ) { int x, y, lcm, m, i, gcd; printf (“enter x, y values”); scanf("%d%d",&x,&y); m = ( x < y) ? x : y; for ( i = 1 ;...

write a program for printing Floyd's triangle

# include<stdio.h> #include<conio.h> void main ( ) { int i, j,k=1; for ( i = 1; i < = 4 ; i ++) { for ( j =1; j < = i; j ++) {  printf("%d\t",k);  k++; } pr...

write a program for printing the following number format

# include<stdio.h> #include<conio.h> void main ( ) { int i, j; for ( i = 1; i < = 4 ; i ++) { for ( j =1; j < = i; j ++) {  printf("%d\t",j); } printf (“\n”); } ...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item