Can someone help me

Recommended Answers

All 18 Replies

Use snippet insertion in writing topics in the forum

In the editor toolbar, click the third button from the left. As Jim points out, it looks like </>. If you hover over it, it should say 'Code Block' in a tooltip.

commented: Important +0

Thanks, but I haven't a editor toolbar. I'm using a smartphone android.

like that?

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cout<<"Enter number of element you want to store: ";
    cin>>n;
    int arr[n],i,j;
    cout<<"Enter array values:\n";
    //taking the array value 
    //from user
    for(i=0;i<n;i++)
    {
        cin>>arr[i];
    }
    //Now we will sort the array
    for(i=0;i<n-1;i++)
    {
        for(j=0;j<n-i-1;j++)
        {
            //checking if previous value is
            //grater than next one or not
            if(arr[j]>arr[j+1])
            {
                //temp will temporarly store
                //the value of arr[j]
                //then we will swap the values
                int temp=arr[j];
                arr[j]=arr[j+1];
                arr[j+1]=temp;
            }
        }
    }
    cout<<"After Bubble sort the array is:\n";
    for(i=0;i<n;i++)
    cout<<arr[i]<<" ";
    return 0;
}

I´m using de notebook to do it, in my smartphone this is not possible.

Yes, on a smartphone, we currently are not showing our full editor. This is on our list of future improvements. As of right now, our full editor is not mobile compatible.

To add code without using our toolbar, use standard markdown syntax. That means a blank line above and below the code block, and each line of code indented by four spaces.

But … umm … are you really posting code blocks from your phone?

I trying, but this message is showing:

Curly braces { } may only be used when posting code.

Do you have any lines of code that include { or } that are not indented by at least 4 spaces, with a blank line above/below?

commented: Vary good +0
#include<bits/stdc++.h>
using namespace std;
int main()

{

    int n;
    cout<<"Enter number of element you 
want to store: ";
    cin>>n;
    int arr[n],i,j;
    cout<<"Enter array values:\n";
    //taking the array value 
    //from user
    for(i=0;i<n;i++)

   {

       cin>>arr[i];

    }

      //Now we will sort the array
       for(i=0;i<n-1;i++)

   {

    for(j=0;j<n-i-1;j++)

      {

            //checking if previous value is
            //grater than next one or not
            if(arr[j]>arr[j+1])

      {

           //temp will temporarly store
            //the value of arr[j]
            //then we will swap the values
            int temp=arr[j];
            arr[j]=arr[j+1];
            arr[j+1]=temp;

          }

      }

 }

  cout<<"After Bubble sort the array is:\n";
  for(i=0;i<n;i++)
  cout<<arr[i]<<" ";
  return 0;

}

Were you able to do that from your phone?

Thanks, I get it now, in my smartphone.
?

I'm using Chrome for android.

Yes, on a smartphone, we currently are not showing our full editor. This is on our list of future improvements. As of right now, our full editor is not mobile compatible.

Update: Our editor has been mobile compatible for well over a year now.

I'm going to mark this question solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.