Posts

covid-19 display

Image
Circuit diagram  Code for covid -19 display #ifdef ESP8266 #include <BlynkSimpleEsp8266.h> #elif defined(ESP32) #include <BlynkSimpleEsp32.h> #else #error "Board not found" #endif #include <ESP32httpUpdate.h> #include <ArduinoHttpClient.h> #include <b64.h> #include <HttpClient.h> #include <HTTPClient.h>  #include <LiquidCrystal.h>  #include <Wire.h>  // Only needed for Arduino 1.6.5 and earlier   LiquidCrystal lcd(22,21,5,18,23,19);   const char* ssid = "Nokia";              //WIFI SSID Name                              const char* password = "muvamr12";        //WIFI Password   const char* host = "api.thingspeak.com";  //We read the data from this host                        ...

data type & declaration

Image
Basic data type The basic data types are datatypes already defined in the programing language Youtube tutorial: Declaring variable All varaiable present in the program must be declared before it is used. The generalform is data-type variable list; Initializing variables  The process of assigning initial value to variable during declaration is called initializing variable The general form is, data-type variable = initial value; Example int a = 10; Assigning value to variables giving values to variable is called assigning values to variable The general form is variable-name = value; Example a=10; cd=25; Declaring variable as constants A constant is quality whose value does not change during program execution The general form is const data-type variable = value; where    const  -- keyword    data-type -- int,float,etc.. Exa...

switch-statement

Image
Switch statement  switch statement is an extension of if...else statement. This permits any number of branches. The general form is switch(expression) { case 1 statement block-1; break; case 2 statement block-2; break; .............. .............. .............. case n statement block-n; break; default  default statement; break; } next statement; the value of the expression will check with the case 1, case2,...casen if any case will matches then execute that case statement.then it moves to the next statement. flow diagram: Example program: #include<stdio.h> #include<conio.h> void main() { int number; clrscr(); printf("Enter your exam mark"); scanf("%d",&number); switch(number) { case 35: printf("low mark"); break; case 50: printf("better mark"); break; case 90: printf(...

for-loop

Image
For statement For statement is used to execute a statement or a group of statement for a known number of times. the general form for(control-variable;condition;increment/decrement) { body of the loop } next statement; If the value of the condition is true then the body of the loop will be executed, then the value of the control-variable will be incremented or decremented.when the conditionis false then the control is transferred to the next statement Block diagram of for-loop Example program #include<stdio.h> #include<conio.h> void main() { int i,sum=0; clrscr(); for(i=1;i<=10;i++) { sum=sum+1; } printf("sum=%d",sum); getch(); } Switch statement   switch statement is an extension of if...else statement.This permits any number of branches. the General fornm is  switch(expression) { case 1 statement block-1; brea...

do-while

Image
Do …while –loop T his statement is executed the body of the loop is will execute first. The general form is do { Body of loop } While(condition); Next statement; when this statement is executed the body of the loop will be executed first then the condition is evaluated. if the value will be true then the body of the loop will be executed. if the value will be false then it will move to next statement. Block diagram of do...while loop example program: #include<stdio.h> #include<conio.h> void main() { int i=1; do { printf("hello world!"); i++; } while(i<5); getch(); } youtube tutorial: For-Loop for statement is used to execute a statement or a group of statement for a known number of times. the general form for(control-variable;condition;increment/decrement) { body of the loop } next statement; Read   Mor...

looping statement

Image
looping statements loop structure are used to execute a group of statements repeatedly until the condition is satisfied. They are     While -loop Do…while-loop For-loop While-loop This will be a simple loop statement.  The general loop structure is While(condition) { body of the loop; } Next statement; When the statement is executed then it will checks the condition is false or not? If it is false then move to next statement or it is true then the loop body will be execute. When the condition becomes false then the control is transferred to next statement Flowchart : Example code for c program #include<stdio.h> #include<conio.h> void main() { int i =1; while (i<=5)   {     printf(“hello world\n”);     i++;   } getch(); } youtube tutorial ...

nested-if

Image
Nested if condition The block of code following the else statement is executed as the condition present in the if statement is false. nested-if. Nested if statements means an if statement inside another if statement syntax if(condition-1) {     if (condition-2)        {         statement        }     else        {         statement block-2;        } } else  {    statementblock-3;  } Flow chart Example for nested if condition in [c-program] #include< stdio.h> void main() {   int a,b,c;   printf("Enter three number");   scanf("%d%d%d",&a,&b,&c);     if(a>b)       {         if(a>c)         ...