English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

What is the output of this statement?????

printf("%s", S+3);

a. abcdefg
b. defg
c. cdefg

2007-06-08 04:25:58 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

The answer is b).

S + 0 = 'abcdefg'
S + 1 = 'bcdefg'
S + 2 = 'cdefg'
S + 3 = 'defg'

2007-06-08 04:36:20 · answer #1 · answered by nzseries1 4 · 0 0

This is one you could of course test for youself.
However, 'b' is the correct answer.
Because S+0 would start from 'a', S+1 would start from 'b', and S+2 would start from 'c'. Remember, arrays are indexed by 0, not by starting at 1 (unless your working with a language other than C, like for instance VB).

2007-06-08 11:39:03 · answer #2 · answered by Chris C 7 · 1 0

fedest.com, questions and answers