Write a program that demonstrates the variety of ways that a string can be printed.
C Programming Language / String in C Language
792Program:
#include int main() { char s[]="Hello, World"; printf(">>%s<<\n",s); printf(">>%20s<<\n",s); printf(">>%-20s<<\n",s); printf(">>%.4s<<\n",s); printf(">>%-20.4s<<\n",s); printf(">>%20.4s<<\n",s); return 0; }
Output:
>>Hello, World<< >> Hello, World<< >>Hello, World << >>Hell<< >>Hell << >> Hell<<
Explanation:
None
This Particular section is dedicated to Programs only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.
# C Tutorials
# JAVA Tutorials
# HTML Tutorials
# Computer Fundamental
# Data Structure
# DBMS Tutorials
SQL
# C# Language
# R Language
# PHP
# Python
# Vue JS