Writing String in C

printf function used with %s print string to the screen.the format %s can be used to display an array of characters that is terminated by the null character.for example statement.


the above statement are used to display the entire contents of the arra name.we can also specify the precision with wich the array is displayed.for example you can used %10.4 indicates that the first four character are to be printed in a field with of 10 columns.



void main()
	char company_name[20] = "Codegyan Pvt Ltd";
Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit

You may also like this!