I have 1 program that I need help with in C    Program 1= (Strings starting with "Th"), write a program that reads a series of strings and prints only those beginning with the letters "Th".   This is the only program I need help with right now, please help me with the answers, They are required in C langauge and plese make sure they work on the online complier of microsoft visual studio.      I did this and i got an error the char starting with Th couldnt show

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

I have 1 program that I need help with in C 

 

Program 1= (Strings starting with "Th"), write a program that reads a series of strings and prints only those beginning with the letters "Th".

 

This is the only program I need help with right now, please help me with the answers, They are required in C langauge and plese make sure they work on the online complier of microsoft visual studio. 

 

 

I did this and i got an error

the char starting with Th couldnt show

+
في علامة تبويب جديدة
X GDB online Debugger | Compiler
x Answered: e 1 program that I ne
O Lab11 - Bb Collaborate
OClass Work + HW:ll Ja Bb
onlinegdb.com A
Run
O Debug
I Stop
E Share
A Save
{} Beautify
Language c
OnlineGDB beta
main.c
online compiler and debugger for c/c++
1
2 #include <stdio.h>
code. compile. run. debug. share.
3 #include<string.h>
4
IDE
5- int main() I
My Projects
char name[100][100];
printf("Enter series of strings:");
for(int i=0;i<5;i++)
scanf("%s",&name[i]);
// read string
printf("string that starts with Th:- \n");
for(int i=0;i<5;i++)
{
if(name[i][®]=='T' && name[i][1]=='h')
//comparing the first character of string with 'T' and second character of string with 'h',if both are true then the string is printed
printf("%s\n",name[i]);
// display string
}
return 0;
7
Classroom new
8
Learn Programming
9
10
Programming Questions
11
Sign Up
12
13
Login
14
15
+ 121K
16
17
18
19
20 }|
input
main.c:8:17: warning: format '%s' expects argument of type 'char
but argument 2 has type
'char (*)[100]' [-Wformat=]
8 |
scanf ("%s", &name [i]);
char (*) [100]
char
Enter series of strings:thor
them
thememe
ice
venom
string that starts with Th:-
...Program finished with exit code 0
Press ENTER to exit console.O
About • FAQ • Blog • Terms of Use • Contact Us • GDB Tutorial •
Credits • Privacy
© 2016 - 2021 GDB Online
ENG E
العنوان
1.
Transcribed Image Text:+ في علامة تبويب جديدة X GDB online Debugger | Compiler x Answered: e 1 program that I ne O Lab11 - Bb Collaborate OClass Work + HW:ll Ja Bb onlinegdb.com A Run O Debug I Stop E Share A Save {} Beautify Language c OnlineGDB beta main.c online compiler and debugger for c/c++ 1 2 #include <stdio.h> code. compile. run. debug. share. 3 #include<string.h> 4 IDE 5- int main() I My Projects char name[100][100]; printf("Enter series of strings:"); for(int i=0;i<5;i++) scanf("%s",&name[i]); // read string printf("string that starts with Th:- \n"); for(int i=0;i<5;i++) { if(name[i][®]=='T' && name[i][1]=='h') //comparing the first character of string with 'T' and second character of string with 'h',if both are true then the string is printed printf("%s\n",name[i]); // display string } return 0; 7 Classroom new 8 Learn Programming 9 10 Programming Questions 11 Sign Up 12 13 Login 14 15 + 121K 16 17 18 19 20 }| input main.c:8:17: warning: format '%s' expects argument of type 'char but argument 2 has type 'char (*)[100]' [-Wformat=] 8 | scanf ("%s", &name [i]); char (*) [100] char Enter series of strings:thor them thememe ice venom string that starts with Th:- ...Program finished with exit code 0 Press ENTER to exit console.O About • FAQ • Blog • Terms of Use • Contact Us • GDB Tutorial • Credits • Privacy © 2016 - 2021 GDB Online ENG E العنوان 1.
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY