Skip to main content
                   Basic C Program
               ===========

​C is a high-level language (language which is understandable to humans to communicate with machine) which lies between assembly language and high-level language.

​It is mainly a procedural programming language that makes user (or programmer) to program using the specified functions buit-in its predefined library. It also provides the feature to create user-defined functions (functiins created by user/programmer with his/her own choice).

​Lets have a look at the basic C-program.

​#include <stdio.h> //pre-processor directory

​int main( ) //defining main() function
​{
​    printf("IT IS FIRST C-PROGRAM AT ITKNOWLEDGE");
​return 0;
​}

​OUTPUT :-


And the program will look in Turbo C++ like :-


​Every C-program starts its execution with the function main() and the compilation process starts with the preprocessor directives (i.e. #include ...). We shall use here Borlands Turbo C++ (now outdated) for programming in C ,which is free to download and  provides IDE(Integrated Development Environment)facility, which is a compiler, not interpreter.

​#include <>
​Every preprocessor deirective has the above format for using the header files. Each header file has functions defined in it to use in the program irrespective of defining them too.

​printf("")

Every function has been defined in its preprocessor directory. printf() has been defined under <stdio.h>​ header file. This function let the user to print desired message(s) to the console monitor (at the display during running of program). Anything written in it is just displayed as it is. Like if we would have written the command as:-

​​printf("I'M LEARNING THROUGH ITK SITE");

​It will give the OUTPUT as:-



​OUTPUT.
​This isn't any function or keyword for C-programming. It actually means the result that will be shown at the screen after the execution of program.

C-language defines its statement till semi-colon( ; ) appears.

Codes in C-programming can be written in as single-line code. As the above code could be written as:-

​#include <stdio.h> int main( ){printf("IT IS FIRST C-PROGRAM AT ITKNOWLEDGE");​return 0;​}
It doesnot affect the OUTPUT of the program. All you have to be careful about is its syntax.


​Basically, C-language is now outdated programming language, but is good to clear the basics and create the mindset towards programming languages. It has emminent feature that let us to clearify our logic to code in specific situation.

​                                                            Regards,
​                                                            ITK

Comments

Popular posts from this blog

ASCII TABLE || HEXADECIMAL TABLE

ASCII & Hexadecimal Table (CLICK THE IMAGE TO VIEW IT PROPERLY) REGARDS, ITK

Calculator Using C Programming

  C  is not only capable in maximizing the logical concept towards machine/software programming but it also makes users comfortable through its in-built functions. Making of simple calculator in C must at least be done by the novices themselves to improve and test their level of understandings in logics being applied. Here is the code that has been created for the joy of creativity through C-coding. CODE #include <stdio.h> #include <conio.h> int main() {     int a,b,result;     char ch[2]; clrscr(); gotoxy(30,1);printf("CALCULATOR"); gotoxy(10,8);printf("FIRST NUMBER : "); gotoxy(4,9);printf("OPERATION(+,-,*,/) : "); //to choose operation from gotoxy(9,10);printf("SECOND NUMBER : "); gotoxy(16,12);printf("RESULT : "); gotoxy(30,18);printf("Powered By : ITK"); gotoxy(25,8);scanf("%d",&a); // input first number gotoxy(25,9);scanf("%s",ch); //input operation as a...

KEYBOARD CHARACTERS || KEYBOARD CHARACTER NAMES || KEYBOARD SYMBOLS AND THEIR USES || KEYBOARD CHARACTERS NAMES

The symbols used in keyboards are generally not known to all of us about. Many of us don't know either their use or their names what they are called as too. Here is the list of the symbols that are in the computer keyboards with their names. Symbols in Keyboards and their names Sl.   No.                    Symbol                                  Name 1                      & ampersand or and 2                        ‘ apostrophe or single quote 3               ...