Skip to main content

Posts

How do solar panels work?

How do solar panels work? How do solar panels work for your home? Step by step overview Solar panels work by absorbing sunlight with photovoltaic cells, generating direct current (DC) energy and then converting it to usable alternating current (AC) energy with the help of inverter technology. AC energy then flows through the home’s electrical panel and is distributed accordingly. Here are the main steps for how solar panels work for your home: Photovoltaic cells absorb the sun’s energy and convert it to DC electricity The solar inverter converts DC electricity from your solar modules to AC electricity, which is used by most home appliances Electricity flows through your home, powering electronic devices Excess electricity produced by solar panels is fed to the electric grid How do solar panels work to generate electricity? A standard solar panel (also known as a solar module) consists of a layer of silicon cells, a metal frame, a glass casing, and various wiri...

Graphics in C: Using Colors in Text Mode

Graphics in C/C++: Using Colors in Text Mode In Advance Learning Tutorial, today we will learn about the colors in C / C + +. So far, you have used only two colors in your program Black and White, Black color in Background and White color foreground, i.e. to print the character. By default, all compilers use these two colors. But if you want to print any character on your screen from the color of your choice, then you can do it with the help of the functions described below. Keep in mind that the functions described below will only run on Text Mode. Using the colors, you can make your program more attractive in C /C++. Total 15 colors have been defined in C++. To use any color, you can use the name of that color or the corresponding value of that color. This value is already defined in the compiler. All the 15 colors and their values are given in the table below. Values of Colors 1. BLACK 0 2. BLUE 1 3. GREEN 2 4. CYAN 3 5. RED 4 6...

Difference between C and C++

Difference between C and C++ C & C++  are computer programming languages that are used to write programs to communicate with computer. Here we will learn what is C and C++ programming languages and what are the differences between them. Firstly we have to know, what is computer programming language? A computer programming language is the medium of communication between computer hardware and user, where user instruct to the computer through some instructions (written in any programming language) to perform some specific types. Now a day there are many popular computers programming languages like – Assembly, C, C++, Java, Android, Ruby, Python etc. C and C++ programming differences C programming language C is a middle level computer programming language developed at Bell Lab at 1972 by Dennis Ritchie, C is considered as Middle Level Language because of its features. C language contains features of Low Level Language as well as High Level Language. C++ programmi...

Palindrome number in C

Palindrome number in C #include <stdio.h>   int   main ( ) {     int   n ,   reverse   =   0 ,   t ;       printf ( "Enter a number :  \n " ) ;     scanf ( "%d" ,   & n ) ;      t   =   n ;       while   ( t   !=   0 )     {       reverse   =   reverse   *   10 ;       reverse   =   reverse   +   t % 10 ;       t   =   t / 10 ;     }       if   ( n   ==   reverse )         printf ( "%d is a palindrome number. \n " ,   n ) ;     else         printf ( "%d isn't a palindrome number. \n " ,   n ) ;       return   0 ; } Output : Enter a number : 12321 12321  is a palindrome number.

C Program to Check whether a given Number is Armstrong

C Program to Check whether a given Number is Armstrong /* * C Program to Check whether a given Number is Armstrong */ #include <stdio.h> #include <math.h>   void main ( ) { int number , sum = 0 , rem = 0 , cube = 0 , temp ;   printf ( "enter a number : " ) ; scanf ( "%d" , & number ) ; temp = number ; while ( number != 0 ) { rem = number % 10 ; cube = pow ( rem , 3 ) ; sum = sum + cube ; number = number / 10 ; } if ( sum == temp ) printf ( "The given no is armstrong no" ) ; else printf ( "The given no is not a armstrong no" ) ; } Output : enter a number : 370 The given no is armstrong no enter a number : 1500 The given no is not a armstrong no

Fibonacci series C program

Fibonacci series C program #include <stdio.h>   int  main ( ) {    int  n ,  first  =   0 ,  second  =   1 ,  next ,  c ;      printf ( "Enter the number of terms \n " ) ;    scanf ( "%d" ,   & n ) ;      printf ( "First %d terms of Fibonacci series are: \n " ,  n ) ;      for   ( c  =   0 ;  c  <  n ;  c ++ )    {      if   ( c  <=   1 )       next  =  c ;      else      {       next  =  first  +  second ;       first  =  second ;       second  =  next ;      }      printf ( "%d \n " ,  next ) ;    }      return   0 ; } Output : Ent...

C Programming convert decimal number to binary

C Programming convert decimal number to binary Examples // convert decimal number to binary #include #include long long convertDecimalToBinary(int n); int main() { int n; printf("Enter a decimal number: "); scanf("%d", &n); printf("%d in decimal = %lld in binary", n, convertDecimalToBinary(n)); return 0; } long long convertDecimalToBinary(int n) { long long binaryNumber = 0; int remainder, i = 1, step = 1; while (n!=0) { remainder = n%2; printf("Step %d: %d/2, Remainder = %d, Quotient = %d\n", step++, n, remainder, n/2); n /= 2; binaryNumber += remainder*i; i *= 10; } return binaryNumber; } Output Enter a decimal number: 19 Step 1: 19/2, Remainder = 1, Quotient = 9 Step 2: 9/2, Remainder = 1, Quotient = 4 Step 3: 4/2, Remainder = 0, Quotient = 2 Step 4: 2/2, Remainder = 0, Quotient = 1 Step 5: 1/2, Remainder = 1, Quotient = 0 19 in decimal...