Computer Science, asked by tonai93, 1 year ago

Actual data(result to be displayed): C Through
printf(":%-15.5s:",s)
Result is :C Thr :
Can anyone explain this?I'm confused.

Answers

Answered by sheshagate
1

1.%s is used for to print string or character array in c.

2.if you take input:C THROUGH

3.then printf("%-15.5s:",s); print 5 characters out of total characters.

like print("%.5s",s);

abone -15.5 indicate .5 means number of characters and -15 indicate i will print hyphens(-----)

Similar questions