Menu

C programming String To store Character Value and Print Character in C


C Programming String

What is String in C ?:-String is a sequence of characters that terminated with a null character, The end of the string is marked with a special character, which is called null character (\0). When the compiler encounters a sequence of characters enclosed in the double quotation marks, it appends a null character “\0” at the end by default. C Programming String and Learn How to print Character in C

Storage of integer and character values in C

 

#include<stdio.h>
int main()
{
const char *strNameList[][2] = {
{“India”,”Delhi”} ,
{“Nepal”,”Kathmandu”} ,
{“Denmark”,”Copenhagen”},
{“Sweden”,”Stockholm”},
{“Norway”,”Oslo”},
{“Bangladesh”,”Dhaka”}

};
int i,j;
int k=1;
for(i=0;i<6;i++)
{
for(j=0;j<1;j++){
printf(“Country =%s Capital = %s\n”,strNameList[i][j],strNameList[i][j+1]);
}
}
return 0;
}

How to Work with Character Variables in C Programming

C Programming String

C Programming String

How to print Character in C

END

C program to draw a square using graphics (clickHere)

String printing as Character Program in C

Note:- Maybe sometime above code doesn’t get user-friendly output, in codeblock ‘or’ any other EDITOR, All of C & C++ program tested in DOS compiler Turbo C.

Also Read

Types of functions in C    Read Here

I hope you will understand better if you study at M.U, in the exam of M.U you know how important this “C programming String. So please don’t forget to give your valuable feedback. Go in the comment section and Give us some feedback about it. C programming String  or My website.

Our team check your every Comment per day Because your one feedback helps us in growing Thesmolt

I request you if you have any doubt or question regarding our site, then please don’t hesitate. We always waiting for your Suggestion.

Note:- If you want to Download This article’s in PDF form, then simply go (Top or Bottom of) Right corner and click on the PRINT icon, and it’s saved as a PDF of  C programming String 

For further questions, you can contact us Via mail [email protected]  otherwise, Our Help Page and Contact us Page, which is included below. I hope I’ll able to say all the possible ways to reach us. Or Download My Android Application Below Download Button.

thesmolt App


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Learn For Free.