×

Difference between C, C++, java

C Language:

C language is a procedure oriented language. It has been invented by Dennis Ritchie in the year 1970. It is one of the computer programming language. The purpose of the language is used to describe the general and specific programming concepts. It is a platform independent language. Based on the concepts of C language the unix Operating System was came into market in the year 1972.

Operating System is the mediator between the user and the computer hard ware. It is completely written in C language programming to perform different facilities to the user and the first operating system is unix OS.

Operating System mainly consists of two kinds of interfaces. They are below:

  • Command line interface
  • Graphical line interface

Command line interface: Command line interface is also known as CLI and it is based on the commands that the user will interact with the computer.

Graphical user interface: Graphical user interface is also known as GUI and it is helpful in seeing graphical icons on the desktop the user will interact with the computer.

There are few more languages that are invented before the C programming language. They are below:

  • Basic combined Programming Language (BCPL)
  • B Language

Basic Combined Programming Language (BCPL): Basic combined programming language is invented by Martin Richards. This language will only describes about the basic command interactions. So this becomes the drawback of basic combined programming language and so started working on it to get better version of the language.

B Language: B Language is invented by Ken Thomsan. The main purpose of this language is to introduce the application specific programming concepts. So due to only specific applications there is no scope to apply the program for wide range of applications. Hence this has become the drawback of the B Language.

Therefore to overcome all the draw backs of the Basic Combined Programming Language and the B Language , Dennis Ritchie has proposed the C programming language in the year 1970. There is a particular structure to C programming.

Structure of C Programming:

To write a program in C language we need to follow a particular structure. Let us see the structure of C program.

Brief structure of C Program:

  1. Documentation Section
  2. Preprocessor Section
  3. Global Declaration Section
  4. Main Section
  5. User Defined Function Section

1.Documentation Section: Documentation Section is used to display the comments. The comments may be single line comments or multi line comments. We use ‘ // ‘ for single line comments at the starting of the comment and we use ‘ /* ----------- */ ‘ for multi line comments.

2.Preprocessor Section: Preprocessor section is also known as link section . Here we use the symbol ‘ # ‘ in the preprocessor section.

3.Global Declaration Section : Global declaration section is used to declare the variable globally throughout the program. We can also declare the functions in global declaration section.

4.Main Function Section : Main Section consists of main function with parameters and the return values. Main function section also consists of the further sections as shown below :

    4.1 {
    4.2 Local declaration of functions and variables
    4.3 Executable statements
    4.4 }

5.User Defined Function Section : User define function section is used to declare the user defined functions and then to define and call the functions. We can call the other functions using call by value and call by reference. User defined function  function section also consists of the further sections as shown below :

    5.1 {
    5.2 Local declaration of functions and variables
    5.3 Executable statements
    5.4 }

There are different kinds of tokens and identifiers and key words in C language. There are nearly 32 keywords in C language.

The primitive data types that are used in C language are :

  • Character data type ( char )
  • Integer data type ( int )
  • Float data type ( float )
  • Double data type ( double )

Let us see a small program for C programming language with an example

Example 1:

//Write a program using C programming
#include<stdio.h>
#include<conio.h>
void main ( void )
{
clrscr( );
printf(“Welcome to C Programming”);
}

Output :

Welcome to C Programming

Related Topics

Heap Sort in Java

Heap Sort in JavaHeap sort in Java uses the data structure binary heap, min-heap, or max heap to do the sorting of elements. Since min-heap always gives the minimum element first,...

8 minutes read.

Pangram Program in Java

If a string comprises all alphabet letters from A to Z or from a to z without regard to case, it is referred to as a pangram. Some examples of pangram...

3 minutes read.

Tower of Hanoi Program in Java

Tower of Hanoi Program in Java The Tower of Hanoi program in Java is written to solve a mathematical puzzle, called Tower of Hanoi, where we have three poles and n...

4 minutes read.

What is string in Java why it's immutable

String in Java Strings are a series of characters commonly used in Java language, which are considered objects in the Java. To create and manipulate strings, java will provide the String...

4 minutes read.

Java String Reader

StreamReaderClass: This class is present in the java.io package. It is a character stream in which string act as a source.This method provides to read characters from a string. Character Stream: This class...

3 minutes read.

Java Integer rotateRight() method

The rotateRight() method of Java Integer class returns the value obtained by rotating the  2’s complement binary representation of the given integer value right by the specified number of bits. Syntax public...

1 minute read.

Java Class Name

How to write a class name? The following considerations should be made while writing class names. The name of the current class shouldn't be based on a preset or existing class. Java keywords...

3 minutes read.

Java Math floorDiv() Method

The floorDiv () method of Math class returns the largest integer value that is less than or equal to the algebraic quotient. It firstly divides the dividend and divisor and...

2 minutes read.

Java Thread class

Thread class The thread represents a part of the process. Every process can have multiple associated threads in which every thread may execute the same or different job. By default, each thread assigns...

16 minutes read.

Get year from date in Java

The getYear() method of the Java date class returns a number calculated by deducting 1900 from the year that contains or starts with the instant in time represented by this...

4 minutes read.

Java Swing Time Picker

Prerequisites In this tutorial, we will learn the time picker in java swing. Before learn time picker, we should learn about java swing. Java Swing Introduction The Java Foundation Classes include Java Swing....

5 minutes read.

Access specifiers in Java

What are access specifiers in Java? Access specifiers in Java are used to determine whether other classes can use a particular field or invoke a particular method. Access specifiers mainly specify...

7 minutes read.

Java Lock

A lock is indeed a threaded synchronization technique similar to Java's synchronized blocks, however, locking can be more complex. It's not like we can completely get rid of the synchronized...

5 minutes read.

Java Keywords

Java Keywords The particular words which are used in java programming language that act like a key or important words to write a code are called java keywords. Java Keywords are...

4 minutes read.

Difference between throw and throws in java

This article shows you the core difference between “throw” and “throws”keywords in Java programming language.The throw keyword tells Java you want another part of the code to deal withthe exception,...

2 minutes read.

Use Of Adapter class in Java

An adapter class in Java enables listener interfaces to be implemented by default. The Delegation Event Model is where the idea of listener interfaces first appeared. It is one of...

3 minutes read.

How to check data type in Java

In this section, we will learn about the methodology to verify the data type in Java. There are mainly two methods in java called as getClass() and getName(). They are...

3 minutes read.

Generic queue in Java

Before understanding how to implement a generic queue in java, one must know about generics and queue in java. Generics in Java Generics are parameterized types. The goal is to enable type...

6 minutes read.

Java Date add Days

In order to operate with the time and the Date in Java, we used the abstract Calendar class. It has several helpful interfaces that enable us to convert dates between...

4 minutes read.

Iccanobif Numbers in Java

In this article, you will be very well equipped with the knowledge of iccanobif numbers in Java. You will also know how they are formed and basic example programs on...

3 minutes read.