Output: 2 6 7 8 1 0
Program:
#include< stdio.h >
#include< conio.h >
void main( )
{
int i = 0;
char a[ ] = "2, 6, 7, 8, 1, 0";
char *p, *b[ 10 ];
p = strtok(a, ",");
while( p != NULL )
{
b[ i++ ] = p;
p = strtok( NULL, ",");
}
for( i = 0; i < 6; i++ )
{
printf("%s", b[ i ]);
}
}
Output:
2 6 7 8 1 0
0 comments:
Post a Comment