I need to translate these java codes to c Thanks 1 public st

I need to translate these java codes to c. Thanks

1. public static void main( String args[] )

{

String line;

int word;

Scanner stdin = new Scanner(System.in);

while ( stdin.hasNextLine() )

{

line = stdin.nextLine();

word = stdin.nextInt();

stdin.nextLine(); // get rid of the newline after the int

System.out.println( \"Read line: \\\"\" + line + \"\\\", extracting word [\" + word + \"]\" );

System.out.println( \"Word #\" + word + \" is: \" + extractWord( line, word ) );

}

stdin.close();

System.out.println( \"\ End of processing\" );

}

Solution

void main()

{

   char line[100];

   int word;

   while(gets(line)!=NULL)

   {

   gets(line);

   scanf(\"%d\",&word);

   printf(\"Read line:\\%s\\,extracting word[%d]\",line,word);

   printf(\"Word #%dis:\",word,extractWord(line,word));

   }

printf(\"\ End of processing\");

}

I need to translate these java codes to c. Thanks 1. public static void main( String args[] ) { String line; int word; Scanner stdin = new Scanner(System.in); w

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site