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 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](/WebImages/39/i-need-to-translate-these-java-codes-to-c-thanks-1-public-st-1118184-1761594423-0.webp)