it gets compiled but it crushes: "programm has stopped working"
Please help me!!!

this is the programm:

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])

 FILE *fp;

int i=0, n;
char allwords[100][40];

if ( (fp=fopen("fraoules.txt","r") )==NULL ){
         printf("To arxeio den mporese na anoixtei\n");

 while(strcmp( allwords[i],"telos")!=0){
    fscanf(fp, "%s", allwords[i+1]);


for(n=0; n<i; n++)
printf("%s", allwords[n]);
  return 0;

I do not understand, you are doing string compare with uninitialized allwords array, before you read word inside the while, shouldn't you use for or do..while and check after reading?.

As well as pyTony's suggestion, in lines 12 and 13 you are trying to open the same file twice.

Your could restart with something like this template. You surely have to read the tutorial for future, if you did not allready. Now you are not taking input from user, but surely you need that knowledge soon. Do not forget to reserve place also for null character terminating the string!

#include <stdio.h>
#include <stdlib.h>

#define BUFFERSIZE 256  // Make sure lines will not be longer than this

char LineBuffer[BUFFERSIZE];

int main ()
    FILE* infile =  fopen("words.txt", "r");
    if(infile == NULL)
        fprintf(stderr, "Failure to open file for reading!");

    while (fgets(LineBuffer, BUFFERSIZE, infile) != NULL)
        // lines will be truncated if longer than BUFFERSIZE
        printf("%s", LineBuffer);   // now output to console