asked 207k views
4 votes
Write an expression whose value is the string that consists of the first four characters of string s.

asked
User Oparisy
by
7.6k points

1 Answer

3 votes

Answer:

The correct expression for the following question is :s[0 : 4]

Step-by-step explanation:

The string is the collection of characters It terminated by the NULL character in the c programming language. The s[0 : 4] expression holds the first four characters of string s. In the expression it starts to the position "0" and goes to the index value "4" .in this string it holds the value up to the four characters.

We can store the four-character in the string:s[0 : 4].

answered
User KItis
by
8.5k points

No related questions found