Posts

Showing posts from March, 2020

How Rocket Accident happened due to float data type error in c | Float data type in c

Image
How Rocket Accident happened due to float data type error in c The Explosion of the Ariane 5 A Floating Point Error That Caused A Damage Worth Half A Billion On June 4, 1996 an unmanned Ariane 5 rocket launched by the European Space Agency exploded just forty seconds after its lift-off from Kourou, French Guiana.  The rocket was on its first voyage, after a decade of development costing $7 billion. The destroyed rocket and its cargo were valued at $500 million. A board of inquiry investigated the causes of the explosion and in two weeks issued a report. It turned out that the cause of the failure was a software error in the inertial reference system. Specifically a 64 bit floating point number relating to the horizontal velocity of the rocket with respect to the platform was converted to a 16 bit signed integer. The number was larger than 32,767, the largest integer storeable in a 16 bit signed integer, and thus the conversion failed. The software ended up t...

Technical Aspects of Fundamental Data types in C

Image
Technical Aspects    Fundamental Data types in C             Why do we need data types like integers, char, double, etc. in programming ? In computer science and computer programming, a data type or simply type is an attribute of data which tells the compiler or interpreter how the programmer intends to use the data. Most programming languages support basic data types of integer numbers (of varying sizes), Floating-point numbers (which approximate real numbers), characters and Booleans. A data type constrains the values that an expression, such as a variable or a function , might take. This data type defines the operations that can be done on the data, the meaning of the data, and the way values of that type can be stored. A data type provides a set of values from which an expression (i.e. variable, function, etc.) may take its values. Data types are used within type systems, which offer various ways of defining, implementing an...

How to use basic Data types in c language

Image
BASIC DATA TYPES IN C LANGUAGE ANSI  C  provides three  types  of  data types A data-type in C programming is a set of values and is determined to act on those values. C provides various types of data-types which allow the programmer to select the appropriate type for the variable to set its value. The data-type in a programming language is the collection of data with values having fixed meaning as well as characteristics. Some of them are an integer, floating point, character, etc. Usually, programming languages specify the range values for given data-type. C Data Types are used to: Identify the type of a variable when it declared. Identify the type of the return value of a function. Identify the type of a parameter expected by a function. Three more data types have been added in C99: _Bool _Complex _Imaginary Data Types and Variable Declarations   #include <stdio.h> int main () { int a = 4000...

Why main( ) function in c is important | Difference between int main( ) and void main( ) in c

Image
The important main( ) function in c Why main function in c is important Here, you will get the correct technical reasons, why main function in c is a starting point of any programming languages. All C language programs must have a  main()  function. It’s the core of every program. It’s required. The  main()  function doesn’t really have to do anything other than be present inside your C source code. Eventually, it contains instructions that tell the computer to carry out whatever task your program is designed to do. The basic main() function When the operating system runs a program in C, it passes control of the computer over to that program. This is like the captain of a huge ocean liner handing you the wheel. Aside from any fears that may induce, the key point is that the operating system needs to know where inside your program the control needs to be passed. In the case of a C language program, it’s the main() function that the op...

How to write c program in Right way

Image
    25 Powerful Rules to write C program in Correct way Basic rules to begin: In separate statement each instruction should be written. Therefore , complete C program consist of set of instructions. The statements in program must be written in sequencial order to get desired output.Unless any logic problem can be arise. All statement should written in small case letters. C has no particular rules for position at which statement is to be typed. In C program every statement must end with ; (semicolon).It act as a terminator. Rules for Comment: Comment in the program should be enclosed within /* ..  */ .Look example below the first line is comment.            For ex. /*This my first program*/                        #include<stdio.h>                        main()     ...

Complete Syllabus of C programming from Beginners to Advance or System Level

Image
C PROGRAMMING IN EASY WAY             DO YOU KNOW ?             How to Effectively use Pre-processor Directives ?            How to create user-define Header file  ?            What are different types of Memory models ?            What are near, far, & huge pointers and their applications  ?            Which is correct int main(), int main(void) or void main(void) ?            What is segmentation addresses & Offset addresses  ?            What is execution penalty in coding  ?            What is ISO/C in respect to current demands ?            How to use Macros effectively  ?            What are re-directi...

The History of c programming language | Everything you need to know

Image
Email: encodetraining@gmail.com C  was developed and implemented on the UNIX operating system on the DEC  PDP-11, by Dennis M. Ritchie. C  is very often referred as a “System Programming Language” because it is used for writing  compilers, editors and even operating systems. C  was evolved during 1971-73 from B language of Ken Thompson, which was evolved (in 1969-70) from BCPL language of Martin Richards. BCPL is the language in which the original hello world program was written. ALGOL developed by committee of European and American computer scientists in 1958 IBM developed Assembly language in 1956-63 Initially IBM  manufactured machinery for sale and lease, ranging from commercial scales and industrial time recorders, meat and cheese slicers, to tabulators and punched cards. C was developed and implemented on the UNIX operating system on the DEC  PDP-11, by Dennis M. Ritchie. C is very often ...