First Program In C Language.

First Program In C Language.

First Program In C Language.

Below you have been provided with many software options. which you can use to run c programming created program software. if you are using windows, linux, unix, mac, or google android operating system. so you can find any one of this software available below or nowadays you will also find many compilers online which give you live online c program run/launch permission.

At the below you can use some of the software for coding c program.

Version Platform

  1. Turbo C – Run In Windows Operating System
  2. Borland C – Run In Linux, Unix, Mac Os X, Operating System
  3. Dev C++ – Windows Operating System
  4. Eclipse Ide – Windows Linux /Mac Operating System
  5. Gcc Compiler – Windows Operating System
  6. Gcc Compiler – Linux (Ubuntu ,Red Hat , Fedora , Mandriva) Operating System
  7. G+ – Linux (Ubuntu ,Red Hat ,Fedora ,Mandriva) Operating System
  8. Anjuta – Linux (Ubuntu) Operating System
  9. Neat Beans – Linux /Windows/Mac Os X, Operating System
  10. Visual Studio – Microsoft Corporation Only Run In Windows Platform Operating System

All data types detail in c programming.

  • Char
  • Short
  • Short int
  • Signed short
  • Signed short int
  • Int
  • Signed int
  • Long
  • Long int
  • Signed long
  • Signed long int
  • Long long
  • Long long int
  • Signed long long
  • Signed long long int
  • Float
  • Double
  • Long double

Derived data types in c programming.

  •  Arrays
  •  Pointers
  •  Structures
  •  Enumeration

Data types and their ranges in c programming.


Data type

Data type size

Data type range
Char1 byte-128 to 127 or 0 to 255
Unsigned char1 byte
0 o 255
Signed char1 byte-128 to 127
Int2 or 4 bytes
-32,768 2
Unsigned int2 or 4 bytes0 to 65,535 or 0 to 4,294,967,295
Short2 bytes
-32,768 to 32,767
Unsigned short
2 bytes

0 to 65,535
Long4 bytes
-2,147,483,648 to 2,147,483,647
Unsigned long
4 bytes
0 to 4,294,967,295
Float4 byte1.2e-38 to 3.4e+38
Double8 byte2.3e-308 to 1.7e+308
Long double10 byte3.4e-4932 to 1.1e+4932

Char data type – char data type stores a single byte, like a character in declaring a variable, character data types is for declaration of variable single character name. Remember that, the character data type only stores a single character in the computer memory location.

Char x;

Char p=’a’;

Char n[ ]={‘s’,’i’,’r’,’o’,’h’,’i’};

Signed char – unsigned char store character data types equal in size, declare unsigned char data type, and store char data type in c program.

Int – int is abbreviated as integer data types. It stores any decimal number without a fraction as a whole integer value. Any part of the mantissa in it means that any c programming operation is a whole number to be performed.

Derived data types in c programming.

  •  Arrays
  •  Pointers
  •  Structures
  •  Enumeration

Arrays – in c programming, you can use arrays to store or display many consecutive strings or characters in a straight line. Whereas in c programming we could store only a single character in four. But using an array we can store many numbers of characters of lines in array format.

Char name[25];

Pointers – a pointer is a memory address value location in c programming. Which you have from the variable location address indication declared in any other c program. Pointers exchange and find these value addresses through call by value and call by reference to the specific variable location at program run time.

Structures – the structure data type is a complete user-defined data type in c programming. Which helps you to combine or merge many other or different types of data types into a single data. This means that you can control many different variables by declaring int, char, float, double, long double, and data type variables in the struct.

Enumeration – enumeration data types help you store and process a single integer or fixed data type variables of the same type. Like an enumeration structure, a single or multiple programming variable helps you process the declared value.

Basic structure of c programming.

#include<stdio.h>

#include<conio.h>

void main( )

{

printf(“\n welcome to c programming”);

getch( )

}

Learn basic structure of c program.

Program each c program object description

#include<stdio.h> */ it declare as standard input output header file */

#include<conio.h> */ conio.h header file support samll math operation in c program */

void main( ) */ void keyword and main function declare in c program */

{ */ left curly braces used to start c program */

int a; */ integer data type variable declare in c program */

float b; */ float data type variable declare in c program */

char c; */ char data type variable declare in c program */

clrscr( ); */ clear screen function, used to clear program output screen */

printf(“\n ——-first program in c language——–”); */ display programoutput in console or cmd window */

printf(“\n ——-welcome to mit academys——–”); */ display programoutput in console or cmd window */

scanf(“%d”,&a); */ read or get input value form user side */

fflush(stdin); */ clear previous run program values in buffer or memory */

getch( ); */ use to stable c program output in console window */

} */ right curly braces stop c program syntex */

Explain each and every component of c program.

Header file – header file appended or displayed at the top of any c program. Each header file used in c programming is used for unique programming purposes. Generally in all c programs, the header file is added to any c program for different purposes. you will find many c programming header files, but here we will use general c header files for general purposes. #include<stdio.h> stdio which is called the standard input-output header combination. And this header file compiles the c program resources as a group.

Void keyword – the void keyword is used to return 0 bytes in the active program. Specially void in any c program to function program where we don’t have to return anything to the program.

Main function – main is a built-in function in the c program. where the main function beginner c program every c program must initially contain the main function. Otherwise, errors will occur in your program.

{ Left curly braces – left curly braces to appear after the c program main function. The left curly brace starts every c program, it indicating that c should start your program from here.

Variable declaration – all necessary program variables are declared below the left curly braces. Every c program developer declares variables in many different ways as per the requirement of their program.

Printf function – the printf function is also used in every c program to display console output information text in every c program. Usually whatever you write between the printf function. It is placed or displayed on your console or commands prompt screen by the printf function.

Scanf function – the scanf function reads the program from the user direct input from the user in the c program. Any key program user enters program values ​​in a console window with the scanf function. Here c programmers accept user input and execute it according to the program logic.

Getch( ) – the getch function stabilizes the program output. You don’t need to use the alt + f5 key in the turbo c program to see the final program result.

Return ( ) – the return function specially used in the c program is used by the c program function to return nothing program value.

} Right curly braces – right curly braces stop or completely terminate each c program below.

Let’s start basic program in c programming.

First program in c language.

#include<stdio.h>

#include<conio.h>

void main( )

{

printf(“\n c programming created by denis m ritchee in 1972”);

printf(“\n welcome to mit academys “);

getch( );

}

Generate output of c program in turbo c.

1. Ctrl + f9 – generate output of c program

2. Alt + f9 – compile active program

3 .Alt + f5 – display last result

4. F2 – save program

Rate this post

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top