answersLogoWhite

0

Define basic structure of c program?

Updated: 8/11/2023
User Avatar

WesamAlMurisi

Lvl 1
10y ago

Best Answer

Documentation section

link section

definition section

Global declaration section

main() function section

{

Declaration part

Executable part

}

subprogram section

(user defined function)

By jancy

Answer: Doesn't really have a structure, but there are some rules you have to follow:

- function-definitions cannot be nested;

- in a code-block, data declaration/definitions must come before the executable statements

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

1) The preprocessor directive which is part of compiler and A c program may have the following preprocessor directive.

like #include <file name>

2)Functions like

main() // here, the function starts.

{ //opening of braces

3)Declarations like:-

declarations;// we will declare n initialise the variables here.

4)Function have block of statements like

statements; // writing of statements.

5) Closing the functions

} // closing of braces.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

In any programming language, a structure provides a way to hold multiple pieces of data (members) in a block that can be referred to using one variable. The C keyword used to define a structure is "struct".

Each member can be of any valid C type. Structs can contain primitive types (ints, floats, etc.), arrays and even structs.

A common tactic with linked lists involves declaring a struct type that contains one or two pointers of the same struct type holding the address of the "next" (and sometime "previous") member. In other words, a linked list is like an array.

See the related links below for more information on C structs.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

int main(int argc, char **argv)

{

return 0;

}

This answer is:
User Avatar

User Avatar

Wiki User

10y ago

The basic structure of a C program is documentations, preprocess or statements, then global declarations.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Define basic structure of c program?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is java program made of?

basic unit of C is structure like procedure ,syntax's, error's compiler etc


Basic control structure available in c plus plus?

The basic control structure in C++ is the if statement.


Basic structure of c n c plus plus?

The basic structure of a C or C++ program is built around types. A structure is a type. A function is a type. A class is a type. All of these types can be built from primitive (built-in) types and can be used to create ever-more complex types.


Define a complex number using c structure?

Just define two fields (whatever those are called in "C" - the parts of the structure), one for the real part, one for the imaginary part.Just define two fields (whatever those are called in "C" - the parts of the structure), one for the real part, one for the imaginary part.Just define two fields (whatever those are called in "C" - the parts of the structure), one for the real part, one for the imaginary part.Just define two fields (whatever those are called in "C" - the parts of the structure), one for the real part, one for the imaginary part.


Can you define a function within a structure?

No, it is the other way around: you can define a structure within a function.In C++ though, structs are actually classes, so they can have methods.


C program to find largest among three numbers?

#define max2(a,b) (b&gt;a?b:a) #define max3(a,b,c) (max2(a,max(b,c)))


How can define date data type in c structure?

struct tm can be an example.


Describe the structure of a c program?

Yes, please do.


How do you pass in Anna university chennai?

Define c-program and give an example


How do you define the structure size in C language?

You cannot define the size of the structure, but you can query it with sizeof.The structure size in C language depends on the elements of the structure.Example:#include struct Test{int v;char str[100];};int main(){printf("The structure size is %d\n", sizeof(struct Test));return 0;}


Basic parts of TURBO C program?

Editor - edits text Compiler - compiles the program Linker - links the program Debugger - helps finding bugs


What has the author Granville C Henry written?

Granville C. Henry has written: 'Computing in BASIC for calculus' -- subject(s): BASIC (Computer program language), Calculus, Data processing, Basic (Computer program language) 'Forms of concrescence' -- subject(s): Prolog (Computer program language)