Open In App

How to add code to existing article (Using Improve Article)?

Last Updated : 03 Apr, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Prerequisite :

How to Improve an Article ?
  1. Click on “Improve Article” button present at below top-right corner of each article.
    • This is the top-right button embedded in circle. You can click on this button to improve it.
  2. Other than adding code, modifying content of article must be avoided.
  3. Sequence for code should be in following order –
  4. During submission of Code Addition Mention ‘LanguageName – Code Addition‘ in Reason to Improve box and Select Type – Code Addition and then click on Submit for Review.
    code__add
    Code Addition

To Add a new code:

  1. Click on the Add Code button present in the Toolbar provided. Improve-Article-02
  2. Click on the Add Another Language button and further select the language to be added from the drop-down list provided. Improve-Article-03
  3. Use the Arrow Keys to change the sequence of the codes. The preferred sequence is given in the 3rd point above. Improve-Article-04
  4. To Format your code, use the Format button provided. Further, use the Run button to check if your code generates the correct output and click on the Proceed button to add your code with the other existing codes. Improve-Article-05

Code Style Guidelines:

  1. In the beginning of every program, please write a line to tell the purpose of program : CPP
    // C++ program to illustrate sum of two numbers
    
  2. Please add a code in a way that there shouldn’t be any blank line after comments and one blank line should be present above the comments in the code. For reference please see the code in the image given below:
    code_comments
  3. Add the code/comments to the code block in a way that prevents horizontal scrolling. If the code exceeds the width of the display, it should wrap to the next line for readability. Please refer to the image below, where horizontal scrolling is present and should be avoided.
    scrollnew
  4. Naming conventions must be followed in the code according to the programming language. Please refer to the following links for the naming convention guidelines for the various programming languages:
    Naming Convention in C++
    Naming Conventions in Java
    Naming Conventions in Python
    Naming Conventions in JavaScript
  5. Variables used in the code, program structure and output should match with the existing code.
  6. Please add following comment at the bottom of your code.
    // This code is contributed by your_name 
  7. Variable names and output of newly added code (for example Java) should be same as existing code (For example C++).
  8. It is strongly recommended to refer general coding guidelines when adding code for any language.

If you found any issue or you have any query and wish to improve an existing article then, you can email us to

improvement@geeksforgeeks.org

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads