Sep 29, 2019

LOGIC GATES


logical gates
logic gates

LOGIC GATES:
  Logical gates are the operator which connect two or more input signals by checking logic between them and form a new signals.
  Some basic logical gates are and the form which easy to understand.
       1.       Not gate
       2.       And gate
       3.       Or gate
       4.       Nand gate
       5.       Nor gate
       6.       Exclusive OR gate 
       7.       Exclusive NOR  gate

NOT GATE:
  Not gate also known as inverter. The function of this gate is to invert the given value when we apply Not gate to a binary value it invert that value. For instance we give 1 to Not gate it convert into 0 and vice versa. We can give only one value at a time to not gate.
Note: 1 means present of current and, 0 means absent of current. And we take True as 1 and False as 0.

Symbol of NOT gate:
logical not gate,
not gate

Ä€= A not

Truth table for NOT gate:
not truth table
truth table for not gate

AND GATE:
   AND gate is a basic logic gate. For understanding this operator let A and B are two binary values. The logic of A and B denoted by A . B (A dot B), A . B is true when both A and B are true otherwise false at any other conditions. For the result become true all the given condition must be true.

Symbol of AND gate:
logical and gate
and gate
Truth table for AND gate:
and gate truth table
truth table for and gate

OR GATE:
   OR gate is also a digital logic gate which can operate in binary number such as A and B are two values. In OR gate the result value became false when the given two are false other true at any other condition.
Note: 1 means present of current and, 0 means absent of current. And we take, True as 1 and False as 0.

Symbol for OR gate:
logical or gate
or gate
Truth table for OR gate:
or gate truth table
truth table for or gate

NAND GATE:
 NAND gate is actually the combination of and gate and not gate. If we put NOT gate after AND gate then it will became NAND gate. It inverts the AND gate result.

Symbol for NAND gate:
logical nand gate
nand gate
Truth table for NAND gate:
nand gate truth table
truth table for nand gate

NOR GATE:
It is actually the combination of OR gate and not gate. If we put NOT gate after OR gate then it will became NOR gate. It inverts the result of OR gate.

 Symbol for NOR gate
logical nor gate
nor gate
Truth table for NOR gate:
nor gate truth table
truth table for nor gate
EXCLUSIVE OR:
 Let A and B are two values. The Exclusive OR A and B are denoted by pÃ…q is the Exclusive OR that is true when exactly one of the A and B is true and false otherwise. It mean pÃ…q is true if only one given value is exactly true otherwise if both/all condition true then the result will be false so only one condition should true.

Symbol for Exclusive OR gate:

xor gate, logical xor gate
exclusive or gate
Truth table for Exclusive OR gate:
truth table for xor gate, xor truth table
truth table for exclusive or gate
EXCLUSIVE NOR GATE:
It also is the combination of Exclusive OR gate and not gate. If we put NOT gate after Exclusive OR gate then it will became NOR gate. It inverts the result of Exclusive OR gate. Means the result will true if the both inputs have same value.

Symbol for Exclusive NOR gate:
xnor gate, logical xnor gate
exclusive nor gate
Truth table for Exclusive nor gate:
xnor truth table, exclusive nor truth table
truth table for exclusive nor gate
















Sep 28, 2019

C++ Programming Examples

c programming examples, c proograms
c++ programming examples
      Recommended link :Basic C++ Programs
      1.       Write a C++ program that takes two numbers and display the product of two numbers
#include<stdio.h>
#include<conio.h>
void main ()
{
int a, b, sum;
printf (“enter two numbers”);
scanf (“%d”, &a);
scanf (“%d”, &b);
sum= a*b;
printf (“product of given number is =%d”, sum);
getch ();
}

      2.       Write a C++ program that takes three numbers to calculate and print the average of the numbers
#include<stdio.h>
#include<conio.h>
void main ()
{
int a, b, c, sum;
float avg;
printf (“enter three numbers”);
scanf (“%d”, &a);
scanf (“%d”, &b);
scanf (“%d”, &c);
sum= a+ b+ c;
avg= sum/3.0;
printf (“Average of given number is =%f”, avg);
getch ();
}

     3.       Write a C++ program to compute the area of a hexagon.
              Area of a hexagon = (6 * s^2)/(4*tan(Ï€/6))
              where s is the length of a side
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main ()
{
int s, b;
float c, area;
printf (“enter the length of hexagon”);
scanf (“%d”, &s);
b= 6* pow (s, 2);
c= 4* tan (3.14/6);
area = b/c;
printf (“Area of hexagon is =%f”, area);
getch ();
}

     4.       Write a C++ program to compute the area of a polygon.
       Area of a polygon = (n*s^2)/(4*tan(Ï€/n))
       where n is n-sided polygon and s is the length of a side
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main ()
{
int s, b, n;
float c, area;
printf (“ Enter the length of polygon”);
scanf (“%d”, &s);
printf (“ Enter the side of polygon”);
b= n* pow(s, 2);
c= 4* tan (3.14/n);
area = b/c;
printf (“Area of polygon is =%f”, area);
getch ();
}

      5.       Write a C++ program to compute the distance between two points on the surface of earth.
Distance between the two points [ (x1,y1) & (x2,y2)]
               d = radius * arccos(sin(x1) * sin(x2) + cos(x1) * cos(x2) * cos(y1 - y2))
               Radius of the earth r = 6371.01 Kilometers
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main ()
{
int x1, x2, y1, y2;
float radius = 6371010, a, b, c, d;
printf (“Enter the given points sequentially  \nx1 = ”);
scanf (“%d”, & x1);
printf (“\n x2=”);
scanf (“%d”, & x2);
printf (“\n y1=”);
scanf (“%d”, & y1);
printf (“\n y2=”);
scanf (“%d”, & y2);
a = sin(x1) + cos(x1) * cos (x2) * cos(y1 – y2);
b = acos (a);
c = b * 180/3.14;
d = radius * c;
printf (“ distance of given points is  =%f”, d);
getch ();
}

      6.       Write a C++ program that accepts an integer (n) and computes the value of n+ nn+ nnn
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main ()
{
int  n, a;
printf (“ Enter number ”);
scanf (“%d”, &n);
b= n* pow(s, 2);
a= n + pow(n,2)+ pow(n,3);
printf (“desired result is =%d”, a);
getch ();

Sep 24, 2019

FICTION DEFINITION


FICTION DEFINITION:
       Literature in the form of prose, especially novels, that describes imaginary events and people.
fiction definition, fiction books
fiction definition 


Types:
There are basically two type of fiction
      1.   Commercial fiction:
Also called genre fiction, categories is western, romance, historical, mystery, fantasy and horror.

      2.   Literary fiction:
Used to distinguish novel that are regarded as having literary merit from genre fiction.
Some book of fiction story

Sr.
no
Type
Book name
Author name
Published date
1
 Science fiction
One World kill
Mark Lawrence
May 1st 2019
2
Romance
Again But Better
Christine Riccio
May 7th 2019
3
Historical
West side
W.M Akers
May 7th 2019
4
Crime and Mystery
The Missing Season
Gillian French
May 21st  2019
5
Fantasy
Red Queen
Margaret Drabble
May 2nd 2019
6
Horror
The Ice House
Tim Clare
May 2019
7
Drama
Within And Without
Deborah
Maroulis
May 28th 2019
8
Suspense
The Night Before
St. Marten Press
 May 14th 2019
9
Women fiction
The farm
Joanne Ramos
May 7th 2019
10
Young adult fiction
Romanov
Nadine Brandis
May 7th 2019
11
Short stories
Exhalation
Ted Chiang
May 7th 2019
12
Classic
Bird King
Willow Wilson
March 12th 2019
13
Library fiction
Ask Again, Yes
Mary Beth Keane
May 28th 2019

what is fiction
fiction definition



Also can download this blog in MS file
                 DOWNLOAD

C++ Function Example

c++ function example program
c++ function program example
Problem:
 Write a C program that accepts two integer values between 25 to 75 and return 1 if there is a common digit in both numbers otherwise 0 .

Program:
#include<stdio.h>
#include<conio.h>
int check (int a, int b)
{
int c,d,r,f;
c=a%10;
d=a/10;
program that split the digit in c++
logical operator example
e=b%10;
f=b/10;
if( c==d || c==e || c==f || d==e || d===f || e==f )
return 1;
else
return 0;
}
void main ( )
{
int a,b,r;
printf(" enter two integer number");\
scanf("%d",&a);
scanf("%d",&b);
if ((a>25 && a<=75) && (b>25 && b<=75))
r= check (a,b);
printf(" the return value is %d ",r);
getch( );
}
 In above program there are two function first use function is user defined function named as check, this type function write is function deceleration. The second is main function from this function at line 6 the instruction is used to call the function.

what is logical operator. See detail


Generate a table in C++


Problem:
Q. Write a program that print a table of any given number by checking the condition if the given is not equal to zero then generate a table. used not operator.

Program:
#include<stdio.h>
#include<conio.h>
int main ()
logical not operator in c.
not operator in c++
{
                int a,b,i;
                printf("enter a number");
                scanf("%d",&a);
                if(!(a==0))
                {
                for(i=1;i<=10;i=i+1)
                {
                                b=a*i;
                                printf("\n%d x%d =%d",a,i,b);
                }
    }
                getch();
}


 what is not operator. see detail

LOGICAL OPERATOR IN C++

logical && operator, logical or operator, logical not operator
logical operator in c++


LOGICAL OPERATOR IN C++:
 In C programming different types of operator is used to perform a special and specific task such as Assignment operator and Airthematic operation likely those logical operator also used to check the logic by identifying the given condition.
We used basic three type of logical operator in C and C++ during programming which are as follow
            1.       And operator  =&&
            2.       Or operator     =||
            3.       Not operator   =!

   AND OPERATOR (&&):
 Type of operator which is used when we have to check two or more condition at a time. && operator allow two or more conditions to be combined in an if statement. The flow of control will execute the given instruction if the all given condition is true otherwise control execute the other instruction after the instruction which should execute in under supervision of if statement.
  
And operator in c++


 In above program the result will display on screen will be ‘Grade B’ gets printed if both the conditions evaluate to true. If one of the conditions evaluate to false then the whole thing is treated as false. if the both condition given above does not true then the control execute the instruction in supervision of else statement.


OR OPERATOR (||):
It also used when we have to check two or more condition at a time. || Operator allow two or more conditions to be combined in an if statement. The flow of control will execute the given instruction if at least one of the given conditions is true. Otherwise control execute the other instruction after the instruction which should execute in under supervision of if statement.

Example:
{
int a=3, b=5, c=3;
if ( a==b || a==c || b==c)
printf(“ Given number is same”);
else
printf(“ no numbers are same”);
}
 The above program after executed will display ‘Given number is same’, because the condition a==c is true in this case. The feature of OR operator is that it will executed the instruction in super vision of if statement if one of the given is true.


NOT OPERATION (!);
 The third logical operator is the NOT operator, written as !. This operator reverses the result of the expression it operates on. For example, if the expression evaluates to a non-zero value, then applying ! operator to it results into a 0. Vice versa.
 Here is an example of the NOT operator applied to a relational expression
 ! (y < 10 )
 This means “not y less than 10”. In other words, if y is less than 10, the expression will be false, since (y < 10) is true. We can express the same condition as (y >= 10).


program used NOT ! operator.