Line Break Tag

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

Find largest element of given array

C Program to find largest element of an Array

In the following program we are initializing a variable (max_element) with the first element of given array and then we are comparing that variable with all the other elements of the array using loop, whenever we are getting an element with the value greater than max_element, we are moving that element to max_element and moving further with the same approach to get the largest element in the max_element variable.

#include <stdio.h>
 
/*  This is our function to find the largest
 * element in the array arr[]
 */
int largest_element(int arr[], int num)
{
    int i, max_element;
    
    // Initialization to the first array element
    max_element = arr[0];
 
    /* Here we are comparing max_element with
     * all other elements of array to store the 
     * largest element in the max_element variable
     */
    for (i = 1; i < num; i++)         
        if (arr[i] > max_element)
            max_element = arr[i];
 
    return max_element;
}
 
int main()
{
    int arr[] = {1, 24, 145, 20, 8, -101, 300};
    int n = sizeof(arr)/sizeof(arr[0]);
    printf("Largest element of array is %d", largest_element(arr, n));
    return 0;
}

Output:

Largest element of array is 300

Comments

Popular posts from this blog

What is HTML Element

O"Level Syllabus Update 2020

What is WWW?