Take FREE!! Online Mettl Mock Test to Crack TechM and Other Companies Written Exams.
Get Off-Campus Placement Jobs Info !!!
Practice Tech Mahindra Essay Topics

Program Discussion :: Linked List

Home > Programs > Linked List

2 / 16

Write a program insert an element into ascending order list

Answer:

#include 

 #include
using namespace std; 
void main()
{
    int i, j, a, n, number[30]; 
    coutn;
    coutnumber[i];
    for (i = 0; i < n; ++i)
    {
        for (j = i + 1; j < n; ++j)
        {
            if (number[i] > number[j])
            {
                a =  number[i];
                number[i] = number[j];
                number[j] = a;
            }
        }
    }
     cout

Asked In :: Virtusa

Post Your Answer Here:

Language:

Post Your Reply Here:



Language:

Post Your Reply Here: