Monday, 17 April 2023

Data Types in C with Examples

 Integer

Integer data types are used to store only numeric data that is numbers they don’t have any fractional component itself.

Example:-

#include <stdio.h>

int main()

{

int num_value = 10;              

printf("%d\n", num_value);

return 0;

}



Float

Floating point types include all types in which a number may have a fractional component, such as 3.14 or pi.

Example:-

#include <stdio.h>

int main()

{

float float_value = 10.55;              

printf("%d\n", float_value);

return 0;

}

Character

Most modern computer programming languages store alphabets, characters by representing each one using a small piece of numeric code.

Example:-

#include <stdio.h>

int main()

{

char char_value = 'T';             

printf("%d\n", char_value);

return 0;

}

Array

Arrays which are collections of data elements all having the same data type, so the execution becomes easy performing some operation on index value.

Example:-

#include <stdio.h>

int main()

{

int arr_value[] = {10, 20, 30, 40, 50};             

printf("%d\n", arr_value[0]);

printf("%d\n", arr_value[1]);

printf("%d\n", arr_value[2]);

printf("%d\n", arr_value[3]);

printf("%d\n", arr_value[4]);

return 0;

}

C contains following topics at TCCI:

Introduction to C, Basic Syntax, Token, Data Types and Variables, Constants, Literals, Storage class, Operators, Loop Controls, For Loop, While Loop, Do-While Loop, Decision Making, Arrays, String, Function, Pointer, Structure, Union, Type Casting, Recursion, Files, Command Line Argument.

Course Duration: Daily/2-Days/3-Days/4-Days

Class Mode: Theory With Practical

Learn Training: At student’s Convenience

For More Information:                                    

Call us @ +91 9825618292

Visit us @ http://tccicomputercoaching.com

 

 

No comments:

Post a Comment