GoConqr has a new look! Let us know what you think.

Notes

C Programming

amey mhaskar English 1 page

Content of the notes (1)

Page 1

Basics of C Programming:

#include <stdio.h> //A link to an external library file that handles standard input/output

int main(void) //A necessary function in every C program

//"int" means that this program must return an integer value

{

int aNumber; //An integer variable

printf( "Please enter a number: " ); //Display a message on the screen

scanf( "%d", &aNumber ); //Receive and store the value entered by the user

printf( "You entered %d", aNumber ); //Display feedback to the user about the recent input received

getchar(); //A "trick" to prevent the program window from closing by waiting

//for an additional character to be typed

return 0; //0 means execution was successful and the operating system is now informed

}

-printf () is used to display a message to the user

-scanf() is used to scan an input given by the user

Directives:

used to import libraries. There are 2 ways of doing this:

1) #include <package name>---- Used to refer to standard headers available with C

2) #include "package name"------ Used to refer or import user created headers or code

3) #define name ----- used to define a macro or a constant eg: #define BUFFER_SIZE 1024

Information

Description
Note on C Programming, created by amey mhaskar on 03/11/2018.
Created by
amey mhaskar
Views
0
Rating

More on C Programming Basics

Feedback

What is it about?

What do you think of the new look?

How do you like it?