Posts

Showing posts from January, 2021

HTML & CSS FIRST Project ( First try to create a website by using html and css )

  Html code :- <!DOCTYPE   html > < html   lang = "en" > < head >      < meta   charset = "UTF-8" >      < meta   name = "viewport"   content = "width=device-width, initial-scale=1.0" >      < title > website css and html </ title >      < link   rel = "stylesheet"   href = "style.css" > </ head > < body >   < header >     < div   class = "nav" >   < ul >     < li >   < a   href = "" >  Home  </ a ></ li >     < li >   < a   href = "" >  about  </ a ></ li >     < li >   < a   href = "" >  project  </ a >   < ul >     < li >   < a ...

C code to create stop watch

#include <fcntl.h>  #include <pthread.h>  #include <stdio.h> #include <stdlib.h> #include <termios.h> #include <unistd.h> // starting from zero #define MIN 0 // 1 hr= 60 min ; 1 min= 60 sec #define MAX 60 #define MILLI 200000 int i, j, k, n, s; char c; pthread_t t1; // Function to perform operations // according keyboeard hit. int keyboardhit(void) {     struct termios oldt, newt;     int ch;     int oldf;     tcgetattr(STDIN_FILENO, &oldt);     newt = oldt;     newt.c_lflag &= ~(ICANON | ECHO);     tcsetattr(STDIN_FILENO, TCSANOW, &newt);     oldf = fcntl(STDIN_FILENO, F_GETFL, 0);     fcntl(STDIN_FILENO, F_SETFL, oldf | O_NONBLOCK);     ch = getchar();     tcsetattr(STDIN_FILENO, TCSANOW, &oldt);     fcntl(STDIN_FILENO, F_SETFL, oldf);  ...

Calculator example using C code

  // Calculator example using C code #include<stdio.h> #include<conio.h> #include<math.h> #include<stdlib.h>   #define KEY "Enter the calculator Operation you want to do:"   // Function prototype declaration void addition ( ) ; void subtraction ( ) ; void multiplication ( ) ; void division ( ) ; void modulus ( ) ; void power ( ) ; int factorial ( ) ; void calculator_operations ( ) ;   // Start of Main Program int main ( ) {      int X = 1 ;      char Calc_oprn ;        // Function call      calculator_operations ( ) ;        while ( X )      {          printf ( "\n" ) ;          printf ( "%s : " , KEY ) ;            Calc_oprn = getche ( ) ;        ...