History, asked by sneetu9919, 1 year ago

Write a program to find the bitwise and of two decimal numbers. An and gate reads 2 input either 0 or 1 and outputs 1 iff both the inputs are 1. Similarly write a program to read two decimal numbers and finds and of two numbers . Example : (3)10 = (011)2 (5)10 = (101)2 and of 3 and 4 is : (1)10 = (001)2

Answers

Answered by Anonymous
1

To find the HCF and LCF of two numbers in C++ programming, you have to ask to the user to enter the two number, to find the HCF and LCF of the given two number to display the value of the HCF and LCM of the two numbers on the output screen as shown here in the following program.

« Previous ProgramNext Program »

Find HCF and LCM in C++

To find the HCF and LCF of two numbers in C++ programming, you have to ask to the user to enter the two number, to find the HCF and LCF of the given two number to display the value of the HCF and LCM of the two numbers on the output screen as shown here in the following program.

C++ Programming Code to Find HCF LCM of Two Numbers

Following C++ program ask to the user to enter any two number to find HCF & LCM, then display the result on the screen :

/* C++ Program - Find HCF and LCM of Two Numbers */

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int a, b, x, y, t, hcf, lcm;

cout<<"Enter two number : ";

cin>>x>>y;

a=x;

b=y;

Similar questions