Question:

What is the structure of c program ?

by  |  earlier

0 LIKES UnLike

What is the structure of c program ?

 Tags:

   Report

6 ANSWERS


  1. Include Header Files and Libraries

    Global variables and Functions Declarations

    Main Function Defenition

    {

      Local Variables Declaration

      Action Block

    }

    Functions Defenition()

    {

      Local Variables Decl.

      Action Block

    }


  2. It is the basic for all high level programming languages.

    Basically it follows Top down Approach

    main()

    {

    ................

    Statement1;

    Statement2;

    }

    function1()

    {

    ................

    Statement1;

    Statement2;

    }

    function2()

    {

    ................

    Statement1;

    Statement2;

    }

  3. main()                    function1()                      function2()

    {                           {                                    {

              statement1;            statement1;                      statement1;

              statement2;            statement2;                      statement2;  

              ÃƒÂ¢Ã‚€Â¦Ã¢Â€Â¦;                       ……..;                               ……;

              ÃƒÂ¢Ã‚€Â¦Ã¢Â€Â¦;                       ……..;                               ……;

    }                           }                                    }

    #include<stdio.h>

    main()

    {

           printf(“Hello, world”);

    }


  4. That's a very generic question so here is a generic outline of a typical c program.

    Headers

    preprocessor stmts

    main entry point

    example:

    #include <stdio.h>

    #define MAX 10

    int main ( int argc, char** argv )

    {

         for ( int i = 0; i < MAX; i++ )

               printf("%s\n","Hello World");

    return 0;

    }

    This is the most basic console program.

  5. For example you can create a structure called person which is made up of a string for the name and an integer for the age. Here is how you would create that person structure in C:

    struct person

    {

       char *name;

       int age;

    };

  6. Hi!

    it is really interesting to tell u that I just answer the same question in my MBA(IT) 1st semester exam.the answer is:-

    main()

    {

    statement1;

    statement2;

    ……;

    ……;

    }

    e.g;-

    #include<stdio.h>

    main()

    {

    printf(“Hello,This is my first program”);

    }

Question Stats

Latest activity: earlier.
This question has 6 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.