Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Codeplaza/7325903 to your computer and use it in GitHub Desktop.

Select an option

Save Codeplaza/7325903 to your computer and use it in GitHub Desktop.
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
#include<time.h>
void loop()
{
int i,temp,limit,a[1000];
cout<<"Enter the limit of the unordered list:";
cin>>limit;
for(i=1;i<=limit;i++)
{
a[i]=rand()%100;
cout<<"nElement "<<i<<":"<<a[i];
}}
void main()
{
time_t first,second;
first=time(NULL);
loop();
second=time(NULL);
cout<<"nnExecution time for the loop is:"<<difftime(second,first)<<"ms";
getch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment