CSE

Welcome To Computer Science & Engineering. This Site Contains Complete Information of Computer Engineering, Computer Science & Engineering, Computer Information System, Software Engineering, Computer Science Course Schedule, Course Tutorial, Suggestions, University Tuition Fees, Study Guideline & More.

Hello World Example

Hello World Example

 A C program basically consists of the following parts:
  Preprocessor Commands  Functions
  Variables  Statements & Expressions
  Comments Let us look at a simple code that would print the words "Hello World": #include int main() { /* my first program in C */ printf("Hello, World! \n"); return 0; } Let us take a look at the various parts of the above program:
 1. The first line of the program #include is a preprocessor command, which tells a C compiler to include stdio.h file before going to actual compilation
. 2. The next line int main() is the main function where the program execution begins.
3. The next line /*...*/ will be ignored by the compiler and it has been put to add additional comments in the program. So such lines are called comments in the program.
 4. The next line printf(...) is another function available in C which causes the message "Hello, World!" to be displayed on the screen.
 5. The next line return 0; terminates the main() function and returns the value 0.

Installation on Windows

Installation on Windows

 To install GCC on Windows, you need to install MinGW
. To install MinGW, go to the MinGW homepage, www.mingw.org, and follow the link to the MinGW download page
. Download the latest version of the MinGW installation program, which should be named MinGW- .exe
. While installing MinGW, at a minimum, you must install gcc-core, gcc-g++, binutils, and the MinGW runtime, but you may wish to install more
. 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++, ar, ranlib, dlltool, and several other GNU tools from the Windows command line.

Installation on Mac OS

Installation on Mac OS

Installation on Mac OS If you use Mac OS X, the easiest way to obtain GCC is to download the Xcode development environment from Apple's web site and follow the simple installation instructions. Once you have Xcode setup, you will be able to use GNU compiler for C/C++. Xcode is currently available at developer.apple.com/technologies/tools/.

Installation on UNIX/Linux

Installation on UNIX/Linux


 If you are using Linux or UNIX, then check whether GCC is installed on your system by entering the

 following command from the command line: $ gcc -v If you have GNU compiler installed on your 

machine, then it should print a message as follows: Using built-in specs. Target: i386-redhat-linux 

 Configured with: ../configure --prefix=/usr ....... Thread model: posix gcc version 4.1.2 20080704 

(Red Hat 4.1.2-46) If GCC is not installed, then you will have to install it yourself using the detailed 

instructions available at http://gcc.gnu.org/install/. This tutorial has been written based on Linux and 

all the given examples have been compiled on the Cent OS flavor of the Linux system.

The C Compiler



The C Compiler
The source code written in source file is the human readable source for your program. It needs to be "compiled" into machine language so that your CPU can actually execute the program as per the instructions given. The compiler compiles the source codes into final executable programs. The most frequently used and free available compiler is the GNU C/C++ compiler, otherwise you can have compilers either from HP or Solaris if you have the respective operating systems. The following section explains how to install GNU C/C++ compiler on various OS. m We keep mentioning C/C++ together because GNU gcc compiler works for both C and C++ programming languages.
Quick Start with C
programming language is perhaps the most popular programming language. C was created in 1972 by
Dennis Ritchie at the Bell Labs in USA as a part of UNIX operating system. C was also used to
develop some parts of this operating system. From that time C programming language has been the
de facto programming language when fast programs are needed or the software needs to interact
with the hardware in some way. Most of the operating systems like Linux, Windows™, and Mac™ are either
developed in C language or use this language for most parts of the operating system and the tools coming
with it.
This course is a quick course on C Programming language. In our first lesson we will first write our first
C program. We will then learn about printing to screen, variables and functions. We assume that you are
familiar with at least one of the popular operating system

C programming tutorial - C programs

About C programs :


C programs with output illustrate various programming concepts - operators, loops, functions, single and double dimensional arrays, performing operations on strings, files, pointers, etc. Download executable files and execute them without compiling the source file. Code::Blocks IDE is used to write programs, most of these will work with GCC and Dev C++ compilers. The first program prints "Hello World" on output device.

C programming tutorial - C Programming Examples

C Programming Examples

This page contains a collection examples on basic concepts of C programming like: loops, functions, pointers, structures etc.
Feel free to use the source code on your system.

Where Use :
 Operating Systems
 Language Compilers
 Assemblers
 Text Editors
 Print Spoolers
 Network Drivers
 Modern Programs
 Databases
 Language Interpreters
 Utilities 

C programming tutorial - Why Use C?

Why Use C?
C was initially used for system development work, particularly the programs that make-up the operating system. C was adopted as a system development language because it produces code that runs nearly as fast as the code written in assembly language. Some examples of the use of C might be: 

C programming tutorial - Facts about C

Facts about C :
C was invented to write an operating system called UNIX. 
 C is a successor of B language which was introduced around the early 1970s.
 The language was formalized in 1988 by the American National Standard Institute (ANSI).
 The UNIX OS was totally written in C.
 Today C is the most widely used and popular System Programming Language.
 Most of the state-of-the-art software have been implemented using C.
 Today's most popular Linux OS and RDBMS MySQL have been written in C.

C programming tutorial - C programming language

C programming language :
C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell Labs.

C was originally first implemented on the DEC PDP-11 computer in 1972. In 1978, Brian Kernighan and Dennis Ritchie produced the first publicly available description of C, now known as the K&R standard. The UNIX operating system, the C compiler, and essentially all UNIX application programs have been written in C. C has now become a widely used professional language for various reasons:  Easy to learn
 Structured language
 It produces efficient programs
 It can handle low-level activities
 It can be compiled on a variety of computer platforms 

C programming tutorial

About The Tutorial :
C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories to develop the UNIX operating system. C is the most widely used computer language. It keeps fluctuating at number one scale of popularity along with Java programming language, which is also equally popular and most widely used among modern software programmers. 

Class vs. Object Class....

Class vs. Object Class..


A description of the common properties of a set of objects.
 • A concept.
 • A class is a part of a program.
 • Example 1: Person
 • Example 2: Album Object
 • A representation of the properties of a single instance.
 • A phenomenon.
 • An object is part of data and a program execution.
 • Example 1: Bill Clinton, Bono, Viggo Jensen.
 • Example 2: A Hard Day's Night, Joshua Tree, Rickie Lee Jones

Encapsulation and Information Hiding, cont.

Encapsulation and Information Hiding, cont.
• What the "outside world" cannot see it cannot depend on!
 • The object is a "fire-wall" between the object and the "outside world".
 • The hidden data and methods can be changed without affecting the "outside world". Hidden data and methods Client interface An object Visible data and methods

Learning Objected Programming

Encapsulation and Information Hiding, cont.
 • What the "outside world" cannot see it cannot depend on!
 • The object is a "fire-wall" between the object and the "outside world"
. • The hidden data and methods can be changed without affecting the "outside world".

Learning Object Oriented Programming

Encapsulation and Information Hiding 
Data can be encapsulated such that it is invisible to the "outside world".
• Data can only be accessed via methods.

Encapsulation and Information Hiding, cont. 
• What the "outside world" cannot see it cannot depend on!
• The object is a "fire-wall" between the object and the "outside world".
• The hidden data and methods can be changed without affecting the "outside world".

Watch Thousands New Movie

Search This Blog

free counters