Posts

C - Basic Syntax

                                                    C - Basic Syntax so i have already  seen the basic structure of a C program, so it will be easy to understand other basic building blocks of the C programming language its  will be easy to understand.                                                  TOKENS IN C A  programming token  is the basic component of source code .  C tokens   are the basic buildings blocks in C language which are constructed together to write a C program. For example, the following C statement consists of SIX  tokens C tokens are of six types. They are, Keywords               (eg: int, while), Identifiers              (eg: main, total), Constants              (eg: 10, 20), Strings                    (eg: “total”, “hello”), Special symbols  (eg: (), {}), Operators              (eg: +, /,-,*) Semicolons In a C program, the semicolon is a statement terminator. That is, each individual statement must be ended with a semicolon. It indic

Compiling and Running Your First C Program

                                            Compiling and Running Your First C Program  in this topic  I ntroduces the basics of C programming in an easy-to-follow format, and includes some exercises you can try on your own to get you started how to save the source code in a file, and how to compile and run it. Open a text editor and add the above-mentioned code. Save the file as  hello.c Open a command prompt and go to the directory where you have saved the file. Type  gcc hello.c  and press enter to compile your code. If there are no errors in your code, the command prompt will take you to the next line and would generate  a.out  executable file. Now, type  a.out  to execute your program. You will see the output  "Hello World"  printed on the screen. $ gcc hello.c $ ./a.out Hello, World! e gcc compiler is in your path and that you are running it in the directory containing the source file hello.c.

Your First Program C - Program Structure

so when we install GCC on Windows, then we  need to install MinGW. so  install MinGW,.  MinGW installation program, which should be named MinGW-<version>.exe. when we installing  Min GW, at  a minimum, so you have to necessary to install  GCC -core, g++  binutils, and the MinGW. Add the bin subdirectory of your MinGW installation to your  PATH environment variable, so that you can specify these tools on the command line by their simple names. After the installation is complete, you will be able to run gcc, g++, after  GNU tools from the windows command line.                                             C- PROGRAM STRUCTURE In this article, you'll learn about structures in C programming; what is it, how to define it and use it in your program. Structure is a collection of variables of different types under a single name. For example:  You want to store some information about a person: his/her name, Membership  number and salary. You can eas