Question: (Write a program, and show the output too) C programming consider this array char cArray [ 5 ][ 18 ] = { Sacramento , sacrame,

(Write a program, and show the output too) C programming

consider this array

char cArray [ 5 ][ 18 ] = { "Sacramento" , "sacrame", "Sacrament", "SacramentoCity" , "Sacramento" } ;

char cName[ 18 ] = "Sacramento" ;

Using strcmp to compare strings, print the indexes of cArray whose strings are same as cName.

That is ,

Index 0 , string Sacramento is the same

Index 1, string sacrame is not the same

Index 2, string Sacrament is not the same

Index 3 , string SacramentoCity is not the same

Index 4, string Sacramento is same

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!