Posts

else-if

Image
if...else if condition The if-else-if Ladder. A common programming construct that is based upon nested ifs is the if-else-if ladder. It looks like this. The conditional expressions are evaluated from the top downward. As soon as a true condition is found, syntax if(condition1) {    statement } else if(condition2) {    statement } -------------------------- -------------------------- else {   default statement } Flow chart Example for if...else if condition in[c-program] #include< stdio.h > /* header file */ #include< conio.h > /* header file */ void main() /* main function start*/ {   int mark;   clrscr();   printf("enter the mark \n ");   scanf("%d",&mark);   if(mark<=30)   {          printf("fail & very low mark\n");   }    el...

if-else

Image
IF..else CONDITION if...else statement is used to execute one group of statement.If the boolen value is equal to true then, the if statement is execute . Otherwise the Else statement will be execute Syntax if(condition) {    true-statement } else {    false-statement } Flow chart for if...else Example for if...else condition in[c-program] #include< stdio.h >           /* header file */ #include< conio.h >           /* header file */ void main()                   /* main function start*/ { int a=10,b=5;                 /*declaring a value*/ clrscr(); printf("the value of a is %d",a); printf("\n the value of b is %d",b); if(a>b)         ...

If condition

Image
IF CONDITION Decision making statement are used to jump or execute a group of statement. If condition is used to execute or skip a group of statment for a condition syntax if(condition) {       statement block; } other statement; flow chart for if condition Example code for if condition in [c-program] #include< stdio.h >   /* header file */ #include< conio.h >   /* header file */ void main()   /* main function start*/ {    int a=10,b;    clrscr();    if(a==10)     {      b=a+a;     }    printf("%d",b);     getch(); } youtube tutorial

if,else-if nested-if

Image
If conditon statement if condition statement An if statement is a programming conditional statement that, if proved true, performs a function or displays information. Below is a general example of an if statement, not specific to any particular programming language.... Read   More If...else condition statement If...else condition statement The else statement specifies a block of code to be executed if the condition is false: if (condition) { // block of code to be executed if the condition is true. } else { // block of code to be executed if the condition is false.... Read More else if ladder condition statement    else if ladder condition statement The if-else-if Ladder. A common programming construct that is based upon nested ifs is the if-else-if ladder. It looks like this. The conditional expressions are evaluated from the top downward. As soon as a true ...

operators in c program

Image
C-Operators An operator is used to do some operation taht can be performed on data.There are eight types of operators in C to do the operations. thery are Types of Operators Arithmetic operators Relation operators Logical operators Conditional operators Increment / Decrement operators Bitwise operators Special operators Short hand assignment operators Arithmetic operators Arithmetiic operator s are used to do the arithmetic Calculation The general form is variable1 AO Variable2 variable -constant(or) variables AO-Arithmetic operator OPERATOR OPERATION EXAMPLE      +   Addition   x=2+2     -   Subraction   y=10-4     *   Multiplication   z=2*2     /   Division   a=8/2     %   Modulo   b=3%2 Relation operators Relation operation is u...

c-program-structure

Image
c-basic structure In basic structure of c program it has a main-function .But in arduino software it has 2 function called setup-function and update-function the code execute from the setup-function let we see what are the basic structure of a program For c program the basic structures are headerfile global variable main()-function statement user-define function Example for basic structure of c #include<stdio.h>     //header file #include<conio.h>      //header file int a=2,b=3,c;      //global variable void main()      // main function start { clrscr(); c=a+b; printf("the a+b=%d",c); getch(); }      // main function end youtube tutuorial