• Register
0 votes
69 views

Solutions:

I am new in programming and my logic is not good, can anyone give the right solution?
Write an expression that evaluates to true if and only if the C-string s equals the C-string "end"?

 

7 5 3
5,380 points

1 Answer

0 votes

Solutions:

Let me try to help you with your query.

The correct answer is: strcmp(s, "end") == 0.
  
Hope this might help you.

 

7 4 2
10,530 points

Related questions

0 votes
1 answer 113 views
113 views
Problem: I am new in programming and stuck in a query, can anyone guide me? Write an expression that evaluates to True if the str associated with s starts with "p"?
asked Feb 17 maddi86 5.4k points
0 votes
1 answer 16 views
16 views
Problem: I am new to programming, I need help, can anyone help me? Write an expression that evaluates to True if and only if s refers to the str "end"?
asked Feb 18 maddi86 5.4k points
0 votes
1 answer 52 views
52 views
Problem: Can anyone help it was actually asked in exam as following and I need to know whether my answer was right or not? Write an expression that whose value is the fifth character of the String name?
asked Feb 24 maddi86 5.4k points
0 votes
1 answer 60 views
60 views
Problem: Write an expression whose value is the str that consists of the third to last character of the str associated with s I tried s[2:] didn't work. Can you please guide me with right solution?
asked Feb 19 maddi86 5.4k points
1 vote
1 answer 78 views
78 views
Problem: Can anyone provide me an expression that executes the loop body as long as the user enters a non-negative number. Thanks in advance.
asked Apr 9 LizzyM 6.1k points