Quantcast
Channel: Microcontrollers, Programming and IoT
Viewing all articles
Browse latest Browse all 1271

Array in ascending order

$
0
0
Hello

I am looking help to understand this program.

array in ascending order in C programming

Code:
#include <stdio.h>

int main(void)
{
    int a[20], i = 0, j = 0, n, t;

    printf ("\n Pramot user to Enter Element: ");
    scanf ("%d", &n);
    printf ("\n");

    for (i = 0; i < n; i++)
    {
        printf ("\n Enter the %dth element: ", (i+1));
        scanf ("%d", &a[i]);
    }

    for (j = 0 ; j <(n-1); j++)
    {
        for ( i = 0 ; i <(n-1) ; i++)
        {...
Array in ascending order

Viewing all articles
Browse latest Browse all 1271

Trending Articles