Strings | Sololearn: Learn to code for FREE!

0

Strings

Hello, I have question about how can I get an output with a string like this: Char word1 [71]; Char word2 [11]; Word1: hello you Word2: hu Output: ello yo That means how can I print my output the first word1 without the word2 letters ? Thanks

2/18/2020 5:47:30 PM

Tariq Faridi

1 Answer

New Answer

+1

hey , use this function to get and display the input in 1st case : scanf("[^\n]",word1); printf("%s",word1); and in 2nd case simply use : scanf("%s",word2); printf("%s",word2);