Basic C language Examples
C Examples
Data Structure C language
Unsolved Questions
Structure
Basic C langauge Tutorial
Programming Textbook
while(scanf("%c",c) != EOF){
}
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
int main()
{
int n = 0;
scanf("%d", &n);
int count = 0;
char s[1000];
char sentence[] = "This is a sample sentence.";
char *word;
char *alphabet;
while(1){
if(count == n+1){
break;
}
count++;
gets(sentence);
// Use strtok to get the first word
word = strtok(sentence, " ");
alphabet = strtok(word," ");
// Loop through the rest of the words
while (word != NULL) {
printf("%s\\n", word);
printf("%s\\n", word);
word = strtok(NULL, " "); // Get the next word
}
}
return 0;
}