/* PROGRAM TO READ & PRINT CHARACTER BY CHARACTER */
# include < stdio.h >
main()
{
char line[ 80 ] , c ;
int i = 0 ;
printf(" \n Enter the a line of characters " );
do
{
c = getchar ( ) ;
line[ i ] = c;
i++;
} while(c != '\n' );
line[ i-1 ] = '\0' ;
i = 0;
while ( line [ i ] != '\0')
{
printf("%c", line [ i ]);
i++;
}
}
# include < stdio.h >
main()
{
char line[ 80 ] , c ;
int i = 0 ;
printf(" \n Enter the a line of characters " );
do
{
c = getchar ( ) ;
line[ i ] = c;
i++;
} while(c != '\n' );
line[ i-1 ] = '\0' ;
i = 0;
while ( line [ i ] != '\0')
{
printf("%c", line [ i ]);
i++;
}
}
Comments
Post a Comment