int n, i, arr[50], j, temp; cout<<"Enter total number of elements :"; cin>>n; cout<<"Enter "<>arr[i]; } cout<<"Sorting array using bubble sort technique...\n"; for(i=0; i<(n-1); i++) { for(j=0; j<(n-i-1); j++) { if(arr[j]>arr[j+1]) { temp=arr[j]; arr[j]=arr[j+1]; arr[j+1]=temp; } } } cout<<"Elements sorted successfully..!!\n"; cout<<"Sorted list in ascending order :\n"; for(i=0; i<n; i++) { cout<<arr[i]<<" "; }
what is the difference between '' and "" ?
ReplyDeletesingle quotes '' are used for character where as double quotes "" represent String .
Delete\n aur endl me kya difference hai c++ quesion?
ReplyDeleteendl is a keyword means end of line ,
Deletewhere as \n is escape literal mean end of line but it can only use inside the double quotes
Hello Sir, pehchan kaun ??
ReplyDeletesir can u upload answer key for ascending order of array, with logic written ??
ReplyDeleteint n, i, arr[50], j, temp;
Deletecout<<"Enter total number of elements :";
cin>>n;
cout<<"Enter "<>arr[i];
}
cout<<"Sorting array using bubble sort technique...\n";
for(i=0; i<(n-1); i++)
{
for(j=0; j<(n-i-1); j++)
{
if(arr[j]>arr[j+1])
{
temp=arr[j];
arr[j]=arr[j+1];
arr[j+1]=temp;
}
}
}
cout<<"Elements sorted successfully..!!\n";
cout<<"Sorted list in ascending order :\n";
for(i=0; i<n; i++)
{
cout<<arr[i]<<" ";
}
What are attribute in html?
ReplyDeleteAttribute Provide Special Functionality for Tags. For example Img tag with src attriute
Delete