Line Break Tag

Image
Line Break Tag Line Break टैग, या `<br>` टैग, HTML का एक inline टैग है जिसका उपयोग टेक्स्ट या सामग्री को एक लाइन से दूसरी लाइन पर ले जाने के लिए किया जाता है। जब आप `<br>` टैग का इस्तेमाल करते हैं, तो वहां जहां यह टैग होता है, वहां का टेक्स्ट या सामग्री एक नई लाइन पर आता है। यहां एक उदाहरण है: ```html <p>यह एक लाइन है।<br>यह दूसरी लाइन है।</p> ``` इस उदाहरण में, `<br>` टैग का उपयोग से "यह एक लाइन है।" और "यह दूसरी लाइन है।" को अलग-अलग लाइनों पर दिखाया जाएगा, जबकि `<p>` टैग से दोनों को एक पैराग्राफ के रूप में प्रदर्शित किया जाएगा। इस टैग का उपयोग किसी भी स्थिति में किया जा सकता है जब आपको टेक्स्ट या सामग्री को अलग लाइनों पर रखना हो, जैसे कि पता, कविता, या गाने के बोल। 

String concatenation without using strcat

C Program to concatenate two strings without using strcat

In the following program user would be asked to enter two strings and then the program would concatenate them. For concatenation we have not used the standard library function strcat(), instead we have written a logic to append the second string at the end of first string.

C program for string concatenation

/* C program to concatenate two strings without
 * using standard library function strcat()
 */
#include <stdio.h>
int main()
{
   char str1[50], str2[50], i, j;
   printf("\nEnter first string: ");
   scanf("%s",str1);
   printf("\nEnter second string: ");
   scanf("%s",str2);
   /* This loop is to store the length of str1 in i
    * It just counts the number of characters in str1
    * You can also use strlen instead of this.
    */
   for(i=0; str1[i]!='\0'; ++i); 
 
   /* This loop would concatenate the string str2 at
    * the end of str1
    */
   for(j=0; str2[j]!='\0'; ++j, ++i)
   {
      str1[i]=str2[j];
   }
   // \0 represents end of string
   str1[i]='\0';
   printf("\nOutput: %s",str1);
   
   return 0;
}

Output:
string_concat
As you can see we have entered two strings and in the output of the program both the strings got concatenated.

Comments

Popular posts from this blog

What is HTML Element

O"Level Syllabus Update 2020

What is WWW?