Sagar Institute of Science, Technology
& Research, Bhopal
Department
of
Computer Science & Engineering
Lab Manual
Session: Jan - Jun. 2025
Subject Code: CS-404
Subject: Computer Organization &
Architecture
Prepared By: Submitted To:
Prof. Ajit Kumar Shrivastava
HOD (CSE)
Sagar Institute of Science, Technology & Research,
Bhopal
Computer Science & Engineering
COURSE FILE
Course Bachelor of Technology
Branch Computer Science and Engineering
Subject COA Lab Manual
Subject Code CS 404
Semester 4th Semester
Session Jan-Jun 2024
Faculty Name
Scheme Grading System
L: Lecture T: Tutorial P: Practical Total Credits
Credit Structure
4 1 2 7
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
Index of Lab Manual
Computer Science &
Department: Session: Jan – June 2025
Engineering
Name of Faculty: Semester: 4th Sem
Computer Organization
Subject: Sub Code: CS 404
& Architecture
Name of the Experiment Planned Date Experiment
S.
Date
No
1 Demonstration of Computer System Hardware
2 Study of Logic Gates
3 Implementation of Logic gates using NAND and NOR
Gates
4 Case Study of Encoder and Decoder
5 Study of Multiplexer and Demultiplexer
6 Write a program to convert decimal number to
Hexadecimal, Octal and binary number.
7 Write a program to convert a Hexadecimal, Octal and
binary number to decimal number.
8 Write a program to find the 1’s and 2’s complement of a
given binary number.
9 Write a program to perform addition and subtraction of
two binary numbers
10 Write a program to perform multiplication of two binary
numbers.
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
Experiment No. 1
AIM OF THE EXPERIMENT: To study personal computer layout system.
Theory –
Computer : A computer in simple terms can be defined as an electronic device that is designed to
accept data, perform the required mathematical or logical operational at high speed and output the
result.
Basic computer organization - A computer is an electronic device that basically perform
Accepting data or (information) / instructions (input)∙ Storing data∙ Processing data∙ Displaying
result (output)∙ Controlling and co-coordinating all operation inside a computer.
Input device : This is the process of entering data & instruction into the computer system. This data
or instruction can be entered into the computer system by using different input devices such as
keyboard, mouse, scanner, joystick, MICR, OMR, BCR, camera etc.
Output device – It is the device that gives information from a computer can be called an output
device. Basically output device are electromechanical device that accepts signal digital data(in this
form of 0 1 and 1 1) from the computer and convert them into human understandable language.
Example: Monitor Printer Projector Plotter Speaker
Memory is an external storage area in a computer which is used to store the data and program either
temporary or permanently. Memory is divided in two groups. Primary memory∙ Secondary memory
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
Primary memory : Primary memory is the main memory i.e internal memory. It is directly accessed
by the CPU. The CPU continuously read the instructions stored in primary memory and execute
them. RAM- Ram is a volatile memory, which is used to store data temporarily. ROM- Rom is a
non-volatile memory, where the system configuration data are stored by the manufacturer.
Secondary memory - It is also called “auxiliary memory or permanent memory”.
Magnetic tape Magnetic tape is a medium for magnetic recording, made of a thin, magnetizable
coating on a long, narrow strip of plastic film.
Floppy disk It has the storage capacity 1.44mb and size is 3.5inch.
Hard disk Storage capacity 1 GB, 10GB, 1tb, 2tb.
A processor, or "microprocessor," is a small chip that resides in computers and other electronic
devices. Its basic job is to receive input and provide the appropriate output. Most desktop computers
contain a CPU developed by either Intel or AMD.
Control unit - It is main unit where instruction should be obeyed and performed time by time.
Alu - In this unit all arithmetically tasked are performed.
Conclusion : From the above experiment we have studied the computer’s structure .
Experiment No. 2
AIM OF THE EXPERIMENT: To study personal computer layout system.
Theory:
AND Gate
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
AND gate produces an output as 1, when all its inputs are 1; otherwise the output is 0. This gate can
have minimum 2 inputs but output is always one. Its output is 0 when any input is 0.
OR Gate
OR gate produces an output as 1, when any or all its inputs are 1; otherwise the output is 0. This gate
can have minimum 2 inputs but output is always one. Its output is 0 when all input are 0.
NOT Gate
NOT gate produces the complement of its input. This gate is also called an INVERTER. It always
has one input and one output. Its output is 0 when input is 1 and output is 1 when input is 0.
NAND Gate
NAND gate is actually a series of AND gate with NOT gate. If we connect the output of an AND
gate to the input of a NOT gate, this combination will work as NOT-AND or NAND gate. Its output
is 1 when any or all inputs are 0, otherwise output is 1.
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
NOR Gate
NOR gate is actually a series of OR gate with NOT gate. If we connect the output of an OR gate to
the input of a NOT gate, this combination will work as NOT-OR or NOR gate. Its output is 0 when
any or all inputs are 1, otherwise output is 1.
Exclusive OR (X-OR) Gate
X-OR gate produces an output as 1, when number of 1’s at its input is odd, otherwise output is 0. It
has two inputs and one output.
Exclusive NOR (X-NOR) Gate
X-NOR gate produces an output as 1, when number of 1’s at its input is not odd, otherwise output is
0. It has two inputs and one output.
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
Conclusion : From the above experiment we have studied the working of all the logic gates.
Experiment No. 3
AIM OF THE EXPERIMENT: Implement logic gates using NAND and NOR Gates.
NAND:
#include<stdio.h>
#include<stdlib.h>
int main()
{
Int a[5]={1,0,1,0,1};
Int b[5]={0,1,1,0,0};
Int i,ans;
for(i=0;i<5;i++){
if (a[i] == 1 && b[i] == 1)
ans = 0;
else
ans=1;
printf("\n%dNAND%d=%d",a[i],b[i],ans);
}
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
}
Output:
NOR:
#include<stdio.h>
#include <stdlib.h>
int main()
{
Int a[5]={1,0,1,0,1};
Int b[5]={0,1,1,0,0};
Int i,ans;
for (i = 0;i <5; i++)
{
ans=!(a[i]+b[i]);
printf("\n%dNOR%d=%d",a[i],b[i],ans);
}
}
Output:
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
Experiment No. 4
AIM OF THE EXPERIMENT: To study the working of encoder and decoder.
Theory:
ENCODER: An encoder is a digital circuit that performs inverse operation of a decoder. An encoder
has 2n input lines and n output lines. In encoder the output lines generates the binary code
corresponding to the input value. In octal to binary encoder it has eight inputs, one for each octal
digit and three output that generate the corresponding binary code. In encoder it is assumed that only
one input has a value of one at any given time otherwise the circuit is meaningless. It has an
ambiguila that when all inputs are zero the outputs are zero. The zero outputs can also be generated
when D0 = 1.
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
Truth Table –
D7 D6 D5 D4 D3 D2 D1 D0 X Y Z
0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 1 0 0 0 1
0 0 0 0 0 1 0 0 0 1 0
0 0 0 0 1 0 0 0 0 1 1
0 0 0 1 0 0 0 0 1 0 0
0 0 1 0 0 0 0 0 1 0 1
0 1 0 0 0 0 0 0 1 1 0
1 0 0 0 0 0 0 0 1 1 1
X = D4 + D5 + D6 + D7
Y = D2 +D3 + D6 + D7
Z = D1 + D3 + D5 + D7
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
DECODER: A decoder is a multiple input multiple output logic circuit which converts coded input
into coded output where input and output codes are different. The input code generally has fewer bits
than the output code. Each input code word produces a different output code word i.e there is one to
one mapping can be expressed in truth table. In the block diagram of decoder circuit the encoded
information is present as n input producing 2 n possible outputs. 2 n output values are from 0 through
output 2n -1.
Let’s take an example of 3-to-8 line decoder.
Truth Table –
X Y Z D0 D1 D2 D3 D4 D5 D6 D7
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
Implementation –
D0 is high when X = 0, Y = 0 and Z = 0. Hence,
D0 = X’ Y’ Z’
Similarly,
D1 = X’ Y’ Z
D2 = X’ Y Z’
D3 = X’ Y Z
D4 = X Y’ Z’
D5 = X Y’ Z
D6 = X Y Z’
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
D7 = X Y Z
Experiment No. 5
AIM OF THE EXPERIMENT: To study the multiplexer and demultiplexer.
Theory:
MULTIPLEXER: Multiplexer means transmitting a large number of information units over a
smaller number of channels or lines. A digital multiplexer is a combinational circuit that selects
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
binary information from one of many input lines and directs it to a single output line. The selection
of a particular input line is controlled by a set of selection lines. Normally there are 2n input line and
n selection lines whose bit combination determine which input is selected.
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
DEMULTIPLEXER: The function of Demultiplexer is in contrast to multiplexer function. It takes
information from one line and distributes it to a given number of output lines. For this reason, the
demultiplexer is also known as a data distributor. Decoder can also be used as demultiplexer. In the
1: 4 demultiplexer circuit, the data input line goes to all of the AND gates. The data select lines
enable only one gate at a time and the data on the data input line will pass through the selected gate
to the associated data output line.
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
Conclusion
In conclusion, a multiplexer (MUX) and a demultiplexer (DEMUX) are two important digital
components used in various applications. A MUX selects a few of several input signals and transmits
them on a single output line, while a DEMUX takes a single input signal and transmits it to one of
several output lines. MUXs are used in data transmission, signal routing, memory addressing, and
computer networks. For example, a MUX can be used to select one of several video inputs to display
on a TV. DEMUXs, on the other hand, are used in memory decoding, signal routing, communication
systems, and computer networks. For instance, a DEMUX can be used to distribute a digital signal to
multiple devices.
Experiment No. 6
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
AIM OF THE EXPERIMENT: Write a program to convert decimal number to Hexadecimal, Octal
and binary number.
PROGRAM :
/*convert decimal to
binary*/ #include<stdio.h>
#include<conio.h>
void main()
{
long int
num,i,j,bnum=0,dnum;
clrscr();
printf("\nEnter a decimal number:");
scanf("%ld",&num);
dnum
=num;
i=1;
for(j=num;j>0;j=j/2)
{
bnum=bnum+(num%2)*i;
i=i*10;
num=num/2;
}
printf("\nThe binary of %ld is %ld", dnum, bnum);
getch();
}
Output:
Enter a decimal number: 25
The binary of 25 is
11001
/*convert decimal to octal number*/
#include<stdio.h>
#include<conio.h>
void main()
{
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
long int
num,i,j,octnum=0,dnum;
clrscr();
printf("\nEnter a number:");
scanf("%ld",&num); dnum=num;
i=1;
for(j=num;j>0;j=j/8)
{
octnum=octnum+(num
%8)*i; i=i*10;
num=num/8;
}
printf("\nThe Octal of %ld is %ld",dnum,octnum);
getch();
}
Output:
Enter a number :79
The Octal of 79 is 117
/*convert number from decimal to hexadecimal*/
#include<stdio.h>
#include<conio.h>
void main()
{
long int dnum,rem,q,dn=0,i,j,temp;
char ch;
clrscr();
printf("\nEnter a decimal number:");
scanf("%ld",&dnum);
q=dnum;
for(i=q;i>0;i=i/16
)
{
temp=i%16;
if(temp<10)
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
temp=temp+48;
else
temp=temp+55;
dn=dn*100+temp;
}
printf("\nThe equivalent hexadecimal number is:");
for(j=dn;j>0;j=j/100)
{
ch=j%100;
printf("%c",ch)
;
}
printf("\n");
getch();
}
Output:
Enter a decimal number :79
The equivalent hexadecimal number is :4F
Enter a decimal number :775
The equivalent hexadecimal number is :307
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
Experiment No. 7
AIM OF THE EXPERIMENT: Write a program to convert a Hexadecimal, Octal and binary number to decimal
number.
PROGRAM :
/*convert binary number to decimal*/
#include<stdio.
h>
#include<conio
.h>
#include<math.
h>
void main()
{
long int bnum;
long int decnum=0,i=0,d;
clrscr();
printf("\nEnter the binary number:");
scanf("%ld",&bnum);
while (bnum!=0)
{
d=bnum%10;
decnum=decnum+d*pow(2,i);
bnum=bnum/10;
i++;
}
printf("\nThe equivalent decimal number is:%ld",decnum);
getch();
}
Output:
Enter the binary number : 1010100
The equivalent decimal number is: 84
/*convert octal number to decimal number*/
#include<stdio.h
>
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
#include<conio.h
>
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
#include<math.h>
void
main()
{
int num,decnum=0,i=0,rem;
clrscr();
printf("\nEnter an octal number(using the digits0---7):");
scanf("%d",&num);
while (num!=0)
{
rem=num%10;
decnum=decnum+rem*pow(8,i);
num=num/10;
i++;
}
printf("\nThe equivalent decimal number is:%d",decnum);
getch();
}
Output:
Enter an octal number(usingthedigits0---7):745
The equivalent decimal number is : 485
Enter an octal number(usingthedigits0---
7):25 The equivalent decimal number is : 21
/*convert hexadecimal number to decimal number*/
#include <math.h>
#include <stdio.h>
#include <string.h>
int main()
{
char hexdecnumber[32] = "A";
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
int decimalnumber, i;
// used to store the power index
int cnt;
// used to store the digit
int digit;
cnt = 0;
decimalnumber = 0;
// iterating the loop using length of hexadecnumber
for (i = (strlen(hexdecnumber) - 1); i >= 0; i--) {
// using switch case finding the equivalent decimal
// digit for each hexa digit
switch (hexdecnumber[i]) {
case 'A':
digit = 10;
break;
case 'B':
digit = 11;
break;
case 'C':
digit = 12;
break;
case 'D':
digit = 13;
break;
case 'E':
digit = 14;
break;
case 'F':
digit = 15;
break;
default:
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
digit = hexdecnumber[i] - 0x30;
}
// obtaining the decimal number
decimalnumber = decimalnumber + (digit)*pow((double)16, (double)cnt);
cnt++;
}
// printing the decimal number
printf("Decimal number is: %d", decimalnumber);
return 0;
}
OUTPUT:
Decimal number is: 10
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
Experiment No. 8
AIM OF THE EXPERIMENT: Write a program to find the 1’s and 2’s complement of a given
binary number.
PROGRAM:
#include <stdio.h>
int main()
{
int n; // variable declaration
printf("Enter the number of bits do you want to enter :");
scanf("%d",&n);
char binary[n+1]; // binary array declaration;
char onescomplement[n+1]; // onescomplement array declaration
char twoscomplement[n+1]; // twoscomplement array declaration
int carry=1; // variable initialization
printf("\nEnter the binary number : ");
scanf("%s", binary);
printf("\nThe ones complement of the binary number is :");
// Finding onescomplement in C
for(int i=0;i<n;i++)
{
if(binary[i]=='0')
onescomplement[i]='1';
else if(binary[i]=='1')
onescomplement[i]='0';
}
onescomplement[n]='\0';
printf("%s",onescomplement);
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
printf("\nThe twos complement of a binary number is : ");
// Finding twoscomplement in C
for(int i=n-1; i>=0; i--)
{
if(onescomplement[i] == '1' && carry == 1)
{
twoscomplement[i] = '0';
}
else if(onescomplement[i] == '0' && carry == 1)
{
twoscomplement[i] = '1';
carry = 0;
}
else
{
twoscomplement[i] = onescomplement[i];
}
}
twoscomplement[n]='\0';
printf("%s",twoscomplement);
return 0;
}
OUTPUT:
Enter the binary number : 1010
The ones complement of the binary number is :0101
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
The twos complement of a binary number is : 0110
Experiment No. 9
AIM OF THE EXPERIMENT: Write a program to perform addition and subtraction of two
binary numbers
PROGRAM:
#include<stdio.h
>
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
#include<conio.h
> #include
<math.h>
intc=0,numa[8]={0},numb[8]={0},diff[8]={0},sum[8]={0
}; void add();
voi
d
su
b()
;
voi
d
ma
in(
)
{
intc
h,i;
do
{
for(i=0;i<8;i++)
{
numa[i]=0;
numb[i] =0;
diff[i]=0;
sum[i]=0;
}
c=0;
printf("\tADDITION-SUBTRACTIONUSINGTWO'SCOMPLEMENT");
printf("\n1.ADD\n2.SUBTRACT\nEnteryourchoice:");
scanf("%d",&ch);
switch(ch){
case1: add();
br
eak;case2
: sub();
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
break;
default:printf("\nInvalidChoice:");
}
printf("\nPress1toContinue...");
scanf("%d",&ch);
}while(ch==1);
}
voi
d
ad
d()
{
int
i;
printf("\nEntertwo8-bitbinarynumbers\n");
printf("\nEnter first number: ");
for(i=0;i<8; i++)
{
scanf("%d",&numa[i]);
}
printf("\nEntersecondnumber:");
for(i = 0; i<8; i++){
scanf("%d",&numb[i]);
}
for(i=7; i >=0; i--){
sum[i]=numa[i]+numb[i]+c;
if(sum[i]>=2){
c=1;
}
else
c=0;
sum[i]=sum[i]%2;
}
printf("\nSumis:");
for(i=0;i<8; i++){
printf("%d",sum[i]);
}
}
void sub()
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
{
int i;
printf("\nEntertwo8-bitbinarynumbers\n");
printf("\nEnter first number: ");
for(i=0;i<8; i++){
scanf("%d",&numa[i]);
}
printf("\nEntersecondnumber:");
for(i = 0; i<8; i++){
scanf("%d",&numb[i]);
}
for(i=7; i >=0; i--){
diff[i]=numa[i]-numb[i];
if(diff[i] < 0){
numa[i-1]=numa[i-1] -1;
}
diff[i]=fabs(diff[i]%2);
}
printf("\nDifferenceis:");
for(i = 0; i<8; i++){
printf("%d",diff[i]);
}
}
Experiment No. 10
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
AIM OF THE EXPERIMENT: Write a program to perform multiplication of two binary numbers using Booth’s
Algorithm
PROGRAM:
#include<stdio.h
>
#include<math.
h>
int a=0,b =0, c=0, a1=0, b1 =0, com[5]={ 1, 0, 0, 0, 0};
intanum[5] ={0},anumcp[5] ={0},bnum[5] ={0};
intacomp[5] ={0},bcomp[5] ={0},pro[5] ={0},res[5] ={0};
void binary()
{
a1=fabs(
a); b1
=fabs(b);
intr, r2,i, temp;
for(i =0; i <5; i++){
r=a1 %2;
a1 = a1 /
2; r2=b1
%2;
b1 = b1 /
2; anum[i]
= r;
anumcp[i]
=r;
bnum[i] =
r2; if(r2 ==
0){
bcomp[i]=1;
}
if(r==0){
acomp[i]=1;
}
}
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
//
partfortwo'scomplementin
g c = 0;
for( i =0; i <5; i++){
res[i]=com[i]+bcomp[i]+c;
if(res[i] >= 2){
c=1;
}
else
c=0;
res[i]=res[i]%2;
}
for(i =4; i >=0;i--){
bcomp[i]=res[i];
}
//
incaseofnegativeinputs
if (a < 0){
c=0;
for(i =4; i >=0;i--){
res[i] =0;
}
for( i =0; i <5; i++){
res[i]=com[i]+acomp[i]+c;
if (res[i] >= 2){
c=1;
}
else
c=0;
res[i] =res[i]%2;
}
for(i =4; i >=0;i--){
anum[i] = res[i];
anumcp[i]=res[i];
}
}
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
if(b<0){
for(i =0; i <5; i++){
temp = bnum[i];
bnum[i]=bcomp[i]
; bcomp[i] =
temp;
}
}
}
voidadd(int
num[]){ int
i;
c=0;
for( i =0; i <5; i++){
res[i] =pro[i] +num[i]+c;
if(res[i]>=2){
c=1;
}
else{
c=0;
}
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
res[i] =res[i]%2;
}
for(i =4; i >=0;i--){
pro[i] = res[i];
printf("%d",pro[i]);
}
printf(":");
for(i =4; i >=0;i--){
printf("%d",anumcp[i]);
}
}
voidarshift(){//forarithmeticshift right
int temp =pro[4],temp2=pro[0],i;
for(i=1;i<5;i++){//shifttheMSBofproduct
pro[i-1] = pro[i];
}
pro[4]=temp;
for(i=1;i<5;i++){//shifttheLSBofproduct
anumcp[i-1] = anumcp[i];
}
anumcp[4] =temp2;
printf("\nAR-SHIFT:");//displaytogether
for (i = 4; i >= 0; i--){
printf("%d",pro[i]);
}
printf(":");
for(i=4; i >=0; i--){
printf("%d",anumcp[i]);
}
}
void main(){
int i, q = 0;
printf("\t\tBOOTH'SMULTIPLICATIONALGORITHM");
printf("\nEntertwonumberstomultiply:"); printf("\
nBoth must be less than 16");
//simulatingfortwonumberseachbelow16
do{
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
printf("\nEnterA:");
scanf("%d",&a);
printf("EnterB:");
scanf("%d",&b);
}while(a>=16||b >=16);
printf("\nExpectedproduct=%d",a*b);
binary();
printf("\n\nBinaryEquivalentsare:");
printf("\nA = ");
for(i =4; i >=0;i--){
printf("%d",anum[i]);
}
printf("\nB= ");
for(i =4; i >=0;i--){
printf("%d",bnum[i]);
}
printf("\nB'+1 =");
for(i =4; i >=0;i--){
printf("%d",bcomp[i]);
}
printf("\n\n");
for(i =0;i <5; i++){
if(anum[i]==q){//justshiftfor00or11
printf("\n-->");
arshift();
q =anum[i];
}
elseif(anum[i]==1&&q==0){//subtractandshiftfor10
printf("\n-->");
printf("\nSUBB: ");
add(bcomp);//addtwo'scomplementtoimplementsubtraction
arshift();
q =anum[i];
}
else{//
addansshiftfor
01 printf("\n--
Sagar Institute of Science, Technology & Research, Bhopal
Computer Science & Engineering
>");
printf("\
nADDB:");
add(bnum);arshi
ft();
q =anum[i];
}
}
printf("\nProductis=");
for (i = 4; i >= 0; i--){
printf("%d",pro[i]);
}
for(i =4; i >=0;i--){
printf("%d",anumcp[i]);
}
}
Output