{"id":153,"date":"2024-06-19T13:34:35","date_gmt":"2024-06-19T13:34:35","guid":{"rendered":"https:\/\/iotthinghub.com\/?p=153"},"modified":"2024-06-19T15:20:36","modified_gmt":"2024-06-19T15:20:36","slug":"c-structure","status":"publish","type":"post","link":"https:\/\/iotthinghub.com\/?p=153","title":{"rendered":"C Structure"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"153\" class=\"elementor elementor-153\">\n\t\t\t\t<div class=\"elementor-element elementor-element-d65cc3a e-con-full e-flex e-con e-parent\" data-id=\"d65cc3a\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-894d0a5 elementor-widget elementor-widget-heading\" data-id=\"894d0a5\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\"><b>C structure<\/b> : C Language has a basic structure as follow-<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f5cd46c elementor-widget__width-initial elementor-widget elementor-widget-image\" data-id=\"f5cd46c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"949\" height=\"648\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/C-Header.jpg\" class=\"attachment-full size-full wp-image-160\" alt=\"\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/C-Header.jpg 949w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/C-Header-300x205.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/C-Header-768x524.jpg 768w\" sizes=\"(max-width: 949px) 100vw, 949px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-0e472c1 e-flex e-con-boxed e-con e-parent\" data-id=\"0e472c1\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-e1a1f7a elementor-widget elementor-widget-text-editor\" data-id=\"e1a1f7a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><strong>In C all statement are executed one by one. If error occurs in one statement then the next statement will not execute and program halt. So care should be taken in each step.<\/strong><\/p><h5><strong>#definition Directive <\/strong><\/h5><p>This instruction are usually placed at the beginning before the main() function. It is usually written in uppercase and should not end with a semicolon.<\/p><h5>Example :-<\/h5><h6>#define PI 3.1416<\/h6><h6>#define MAX 180<\/h6><h6>#define PRINCPAL=1000.00;(illegal)<\/h6><p>\u00a0<\/p><h5><strong>#include Directive<\/strong><\/h5><p>#include&lt;filename&gt;<\/p><p>Filename is the name of the library file that contents the required function definition. Preprocessor directives are placed at the beginning of a program.<\/p><p>#include &#8220;filename.h&#8221;<\/p><p>Filename is your own library function or the library function of the preprocessor. We will demonstrate it later.<\/p><h5><strong>main function\u00a0 <\/strong><\/h5><p>The main is a part of every C program. C permits different forms of main statement. The basic structure of main is-<\/p><p><img decoding=\"async\" class=\"alignnone wp-image-188 size-large\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Return-Function-1024x271.jpg\" alt=\"\" width=\"640\" height=\"169\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Return-Function-1024x271.jpg 1024w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Return-Function-300x79.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Return-Function-768x203.jpg 768w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Return-Function.jpg 1127w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p><p>Note that void can be representing as void or empty first bracket i.e. ()<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Example:-\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 int main(void) {\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0<\/p><p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Executable part;<\/p><p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return 0;<\/p><p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }<\/p><p>Rules\u2014Every statement in C program must end with semicolon except #include or #define directive and main statement.<\/p><h5><strong>Variable installation<\/strong><\/h5><h6>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0Data_type variable_name=initial_value;<\/h6><h5><strong>Primary data type<\/strong><\/h5><p><img decoding=\"async\" class=\"aligncenter wp-image-192 size-large\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Data-Type-1024x498.jpg\" alt=\"\" width=\"640\" height=\"311\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Data-Type-1024x498.jpg 1024w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Data-Type-300x146.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Data-Type-768x374.jpg 768w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Data-Type.jpg 1373w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p><p>Note that every signed variable includes positive or negative number but unsigned variable include only positive number.<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Example:-<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 int a;<\/p><p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 int a,b,c;<\/p><p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0unsigned char sample;<\/p><p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0float pi=3.1416;<\/p><p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0double a,b,c=2.1;<\/p><p>If we don\u2019t include initial value in variable declaration by default its value should be zero.<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 In C not only do all variable have a data type, they also have a storage class. The following variable storage classes are most relevant to function-<\/p><ol><li><h6>Automatic variable<\/h6><\/li><li><h6>External variable<\/h6><\/li><li><h6>Static variable<\/h6><\/li><li><h6>Register variable<\/h6><\/li><\/ol><p><strong>\u00a0<\/strong><\/p><p><strong>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span style=\"text-decoration: underline;\">Automatic Variable<\/span> :- <\/strong>Automatic variable are declared inside a function in which they are to be utilized. They are created when the function is called and destroyed automatically when the function is exited.<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Example:-<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 int main(void)\u00a0{<\/p><p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 char classroom;<\/p><p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0int c,d,e=123;<\/p><p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0return 0;<\/p><p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0}<\/p><p>\u00a0<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong><span style=\"text-decoration: underline;\">External Variable<\/span> :- <\/strong>Variable that are both alive and active thought the entire program are known as External variable. They are also known as global variable. External variable are declared outside a function.<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Example:-<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 float length=7.5;<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 int main(void){<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return 0;<\/p><p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"text-decoration: underline;\"><strong>Static Variable<\/strong><\/span> :- static variable may be internal or external depending on there declarations i.e. static int count = 0;<\/p><p><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"text-decoration: underline;\">Register variable<\/span><\/strong> :- it is a register type local variable that store in cpu\/mcu storage cells which is often called register. i.e. register int a=30;<\/p><p>Interger type variables have the following format that used bit wise operation and math calculation.<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-201\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/uint-funtion-300x157.jpg\" alt=\"\" width=\"250\" height=\"131\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/uint-funtion-300x157.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/uint-funtion.jpg 632w\" sizes=\"(max-width: 250px) 100vw, 250px\" \/><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-467e252 elementor-widget__width-initial elementor-widget elementor-widget-text-editor\" data-id=\"467e252\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h5><strong>Arithmetic operators<\/strong> :<\/h5><p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-205 aligncenter\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Arthimatic-Operation-300x117.jpg\" alt=\"\" width=\"300\" height=\"117\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Arthimatic-Operation-300x117.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Arthimatic-Operation.jpg 727w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p><p>Note that Module division only applies to integer data type.<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Example:-<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #include&lt;stdio.h&gt;\u00a0 &#8212;&#8212;-&gt;Header file<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 int main(void)<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 int a,b,c;\u00a0 &#8212;&#8212;&#8211;&gt; Declaration of variables<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 a=10;\u00a0\u00a0\u00a0\u00a0\u00a0 &#8212;&#8212;&#8211;&gt;\u00a0 Initialization of variable<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 b=25;\u00a0\u00a0\u00a0\u00a0\u00a0 &#8212;&#8212;&#8211;&gt; \u00a0Initialization of variable<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 c=a+b;\u00a0\u00a0\u00a0 &#8212;&#8212;&#8211;&gt;\u00a0 c=35<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 c=b-a;\u00a0\u00a0 &#8212;&#8212;&#8211;&gt;\u00a0 c=15<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 c=a*b;\u00a0\u00a0 &#8212;&#8212;&#8211;&gt;\u00a0 c=250<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 c=a\/b;\u00a0\u00a0 &#8212;&#8212;&#8211;&gt;\u00a0 c=2<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 c=a%b;\u00a0 &#8212;&#8212;-&gt;\u00a0 c=5(remainder)<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 return 0;<\/p><p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }<\/p><p>\u00a0Note that <strong>stdio.h<\/strong> is the standard I\/O library function.<\/p><h6>Relational operators<\/h6><p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-213\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Arthimatic-Operation-1-300x117.jpg\" alt=\"\" width=\"380\" height=\"148\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Arthimatic-Operation-1-300x117.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Arthimatic-Operation-1.jpg 727w\" sizes=\"(max-width: 380px) 100vw, 380px\" \/><\/p><p>Relational operators are used in condition or looping operation that will discuss later.<\/p><p>Shorthanded Assignment operators<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-220\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Shorten-Opeartor-300x88.jpg\" alt=\"\" width=\"380\" height=\"111\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Shorten-Opeartor-300x88.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Shorten-Opeartor.jpg 713w\" sizes=\"(max-width: 380px) 100vw, 380px\" \/><\/p><h6><strong>Comments<\/strong><\/h6><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 For a single line comments use a double back space<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 i.e. <span style=\"color: #00ff00;\">\/\/EEE RUET<\/span><\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 For multiline comments begin with \/* and ends with *\/<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 i.e. <span style=\"color: #00ff00;\">\/***************** EEE RUET ****************************\/<\/span><\/p><p>Increment and decrement operator<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-224\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Increment-300x58.jpg\" alt=\"\" width=\"380\" height=\"74\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Increment-300x58.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/Increment.jpg 732w\" sizes=\"(max-width: 380px) 100vw, 380px\" \/><\/p><p>++m;\u00a0\u00a0 <span style=\"color: #00ff00;\">\/\/ increment at run time<\/span><\/p><p>\u00a0&#8211;m;\u00a0 <span style=\"color: #00ff00;\">\/\/decrement at run time<\/span><\/p><p>\u00a0m++; <span style=\"color: #00ff00;\">\/\/increment by one at the next line<\/span><\/p><p>\u00a0m++; <span style=\"color: #00ff00;\">\/\/decrement by one at the next line<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>C structure : C Language has a basic structure as follow- In C all statement are executed one by one. If error occurs in one statement then the next statement will not execute and program halt. So care should be taken in each step. #definition Directive This instruction are usually placed at the beginning before [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-153","post","type-post","status-publish","format-standard","hentry","category-basic-interface"],"_links":{"self":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=153"}],"version-history":[{"count":64,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/153\/revisions"}],"predecessor-version":[{"id":234,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/153\/revisions\/234"}],"wp:attachment":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}