×

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

How to generate random numbers in Java

Random numbers, also known as fake numbers, are actually a part of a very large sequence, so they are called random numbers. In a defined set of numbers, every number...

6 minutes read.

Package naming convention in Java

It is conceivable that many programmers will use the same name for various types, given that Java programmers from all over the world create classes and interfaces. For illustration, suppose...

4 minutes read.

Java inheritance with Example

Java inheritance Java inheritance is a mechanism in which a child object acquires all the properties and behaviors of a parent object. It helps in reusing the code and establishes...

7 minutes read.

Sealed Class in Java

What is a Sealed Class in Java? In programming, the two main issues that must be taken into account when creating an application are security and control flow. The use of...

5 minutes read.

Java concurrency interview questions

During technical interviews, one of the most challenging and sophisticated subjects is concurrency in Java. This page offers responses to some of the related interview questions you might come across. 1....

11 minutes read.

public static void main string args meaning in java

In java main() method is the initial point for execution of the program. If a program doesn’t contain the main method, the program will not execute. JVM(java virtual machine) starts...

3 minutes read.

Java HashMap

Java HashMap extends AbstractMap and implements Map interface. It is the collection of multiple entries where an entry consists of key and value pair. The HashMap can contain only one...

7 minutes read.

History and Evolution of Java

Java is invented by James Gosling, Patrick Naughton, Chris Warth, Ed Frank, and Mike Sheridan at Sun Microsystems, Inc. in 1991. Java is related to C++, which is inherited from...

3 minutes read.

Empty Statement in Java

The three sorts of statements in Java are control, expression, and declaration statements. Additionally, another statement is referred to as an empty statement. In this section, we will discuss about...

4 minutes read.

Java Boyer Moore

A string searching or matching technique called the Boyer-Moore algorithm was created in 1977 by Robert S. Boyer and J. Strother Moore. It is the most popular and effective string-matching...

9 minutes read.

Two Decimal Places Java

When a double data type is used in Java before a variable, this indicates 15 digits after decimal point. However, there are situations when we only require 2 decimal places...

4 minutes read.

Compile time vs Runtime in java

Introduction: This article will discuss compile time vs. runtime in java. Compile time and runtime are two programming terms utilized in software improvement. Compile time is when the source code is...

3 minutes read.

Java Full Stack

A person who can create both the front end and back end of an application is a full-stack developer. In essence, the term "Java full-stack" refers to a web developer...

9 minutes read.

How to create a linked list in Java

Introduction: The linked listing is one type of linear statistics shaped like an array. Not like arrays, linked listing factors aren't stored in a contiguous place. The elements have linked...

3 minutes read.

JDBC Program in Java

JDBC Program in Java JDBC is an API that defines how a client may access a database. It is a part of Java Standard Edition (Java SE). JDBC stands for Java...

4 minutes read.

Advantages and Disadvantages of Strings in Java

What is a String? Java is an object-oriented, platform-independent, high-level, general-purpose, and interpreted programming language.Sun Microsystems is known as the founder of java in 1991; the Java programming language was developed...

4 minutes read.

Java Polymorphism

The process of representing one form in multiple forms is known as Polymorphism. Polymorphism is derived from 2 Greek words: poly and morphs. The word "poly" means many and "morphs" means forms. So polymorphism means...

5 minutes read.

Java extend multiple classes

In Java, what does extend mean? One of several Java inheritance keywords is extended, meaning we pass all or most of the Parent class's characteristics through to the Child class. The...

3 minutes read.

Java Math log1p() Method

The log1p() method of Math class returns the natural logarithmic sum for the specified double argument and 1. Its value is much closer to result of ln(1 + x). Syntax: public static...

2 minutes read.

Features of Java

The objective of the Java programming language is to provide portability, security, and simplicity. In spite of this, Java has a number of features that makes it a popular language...

5 minutes read.