×

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

Java vs DotNET

Before understanding the differences between DotNET and Java, one must know about Java and DotNET. Java Java is a general-purpose programming language that is class-based and object-oriented, with minimal implementation dependencies. Regardless of...

9 minutes read.

Internal Working of ArrayList in Java

Java's version of a resizable array is called ArrayList. The dynamic growth of an array list ensures that there is always room for new elements. ArrayList's backing data structure is...

8 minutes read.

Java Implements Keyword

To understand about the keyword implements we need to learn about the concept of the interfaces and inheritance in java programming languages. So let us learn about the interface and...

3 minutes read.

Java Integer compareTo() method

The compareTo() method of Integer class compares two Integer objects numerically. Syntax public static int compareTo(int anotherInteger) Parameters The parameter ‘anotherInteger’ represents the Integer to be compared. Specified by This method is specified by compareTo in...

2 minutes read.

Java Thread Lifecycle: States and Stages

Multithreading Multithreading is one of the most important features in object-oriented programming, and this multithreading can be implemented by various object-oriented programming languages like Java, Python, and C++. A multithreaded process...

7 minutes read.

Abstract classes in Java

Abstract classes in Java Java uses the 'abstract’ keyword to make a class abstract. Such classes are known as abstract classes, and the process is known as abstraction. In programming language, abstract...

4 minutes read.

What’s New in Java 15

Sealed classes are the new concept that was introduced by Java 15. Sealed classes are a preview feature. Most of the features which are released in java 15 are in...

3 minutes read.

Java Transient

Java Transient In Java, Serialization is used to convert an object into a stream of the byte. The byte stream consists of the data of the instance as well as the...

3 minutes read.

Java this keyword

This Keyword in Java This keyword can be used in many different ways in Java. This is a reference variable in Java that points to the active object. In Java, the...

8 minutes read.

Java String equals() method

equals() method compares two string based on the their content. Syntax public boolean equals(Objects anObject) parameter anObject: Object to be compared with the current String. Returns It returns true when the current String is equivalent to...

1 minute read.

Collection Interfaces in Java with Examples

In this tutorial, we will discuss collection interfaces in Java with Examples. Introduction The Collection Interface is an individual from the Java Collections Framework. It is a root point of interaction of...

4 minutes read.

Objects and Classes in Java

Objects and Classes in Java Classes and objects are the basic concepts of object-oriented programming. It revolves around the real world entity. In Java, the object is a physical and logical...

5 minutes read.

TreeSet in Java

Java TreeSet with Example Java TreeSet implements the Navigable Set interface. It stores the objects in ascending order. It contains unique elements. Access and retrieval time is fast. It does not...

8 minutes read.

Java LDAP Authentication

WHAT IS LDAP? Clients can communicate with directory services by sending requests and receiving responses using the Lightweight Directory Access Protocol (LDAP). The term "LDAP server" refers to a directory service...

7 minutes read.

Ganesha’s Pattern in Java

This part teaches us how to use stars and other special characters to write Ganesha's Pattern in Java programming. Among the most challenging Java pattern applications to code. The Ganesha will be...

3 minutes read.

How to Convert String to float in Java

How to Convert String to Float in java It is used if you want to perform mathematical operations on the string that contains float number. You can convert String to float...

3 minutes read.

URLConnection Class

What is the URL? URL stands for Uniform Resource Locator, is used to specify addresses on the World Wide Web. A URL relates to the identification of any resource connected to the web. URL syntax: Protocol://hostname/other_information(files...

6 minutes read.

Java Command not found

Java Command not found error is displayed if Java is not installed on the computer or if the command prompt cannot find Java.exe to run the program. Our Java software...

3 minutes read.

How to Convert double to int in Java

The double is a larger data type than int. When we assign a larger type value to a variable of smaller type, then we need to perform the explicit conversion....

2 minutes read.

Get yesterdays date by no of days in Java

In this tutorial, we are going to learn how to get yesterday’s date by the no of days in Java. Using the Calendar class, one can get the current date....

1 minute read.