Assignment ES 2200: Submitted By
Assignment ES 2200: Submitted By
FOR
ES 2200
SUBMITTED BY,
NATHAN CIESO
ROLL NO:B/18/EE/023
%d\n",myarray[i],&myarray[i++]);
}}
return (0);
2. write a program in c to concatenate a string.
main()
strcat(a, b);
return 0;
Ams: #include<stdio.h>
num, i, loc;
&num);
//Read elements in an array
&arr[i]);
1] = arr[loc]; loc++;
arr[i]);
return (0);
main()
{
char s[100];
strrev(s);
return 0;
int main()
int a[10000],i,n,key;
scanf("%d",&a[i]);
&key);
for(i=0; i<n; i++)
if(a[i]==key)
return 0;
int i, j, a, n, number[30];
scanf("%d", &n);
scanf("%d", &number[i]);
a = number[i];
number[i] = number[j];
number[j] = a;
printf("%d\n", number[i]);
main ()
Ans: #include<stdio.h>
#include<string.h> int
main()
strcpy(destination, source);
return 0;
}
main()
length;
printf("Enter a
string to calculate
its length\n");
gets(a);
length = strlen(a);
return 0;
int main()
long array[100], n, c;
printf("Enter number of elements\n"); scanf("%ld",
&n);
&array[c]);
bubble_sort(array, n);
array[c]);
return 0;
{ long c, d, t;
list[d] = list[d+1];
list[d+1] = t;
void main()
{
int arr1[10][10],i,j,n; int
det=0;
for(i=0;i<3;i++)
det = det + (arr1[0][i]*(arr1[1][(i+1)%3]*arr1[2][(i+2)%3] -
arr1[1][(i+2)%3]*arr1[2][(i+1)%3]));
printf("\nThe Determinant of the matrix is: %d\n\n",det);
}
Ans: #include<stdio.h>
#include<conio.h> void
main()
scanf("%d",&arr1[i][j]);
i<3; i++)
scanf("%d",&arr2[i][j]);
}
printf("Subtracting array (array1-array2) ... \n");
arr3[i][j]=arr1[i][j]-arr2[i][j];
printf("\n");
getch();
Ans: #include<stdio.h>
(j = 0; j < 3; j++)
{ scanf("%d", &b[i][j]);
printf("\n");
printf("\n");
}
//Multiplication Logic for (i = 0; i <=
[j];
c[i][j] = sum;
(j = 0; j < 3; j++)
printf("\n");
return (0);
Ans: #include<stdio.h>
return (0);
}
Ans:
18.write the difference between call by value and call by reference.
Ans: In Call by value, a copy of the variable is passed whereas in Call by reference, a variable
itself is passed. In Call by value, actual and formal arguments will be created in different
memory locations whereas in Call by reference, actual and formal arguments will be created in
the same memory location
1 A copy of the value is passed into the function An address of value is passed into the function
2 Changes made inside the function is limited to the Changes made inside the function validate outside of the
function only. The values of the actual parameters do function also. The values of the actual parameters do
not change by changing the formal parameters. change by changing the formal parameters.
3 Actual and formal arguments are created at the Actual and formal arguments are created at the same
different memory location memory location
Ans: A computer peripheral is a device that is connected to a computer but is not part of the core
computer architecture. The core elements of a computer are the central processing unit, power supply,
motherboard and the computer case that contains those three components. Technically speaking,
everything else is considered a peripheral device. However, this is a somewhat narrow view, since
various other elements are required for a computer to actually function, such as a hard drive and
random-access memory (or RAM).
There are many different peripheral devices, but they fall into three general categories:
Peripheral devices can be external or internal. For example, a printer is an external device that you
connect using a cable, while an
Ans:
a) floppy disk drive : A floppy disk, also known as a floppy, diskette, or simply disk, is a type of disk
storage composed of a disk of thin and flexible magnetic storage medium, sealed in a rectangular
plastic enclosure lined with fabric that removes dust particles. Floppy disks are read and written
by a floppy disk drive (FDD).
b) Hard disk drive : A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an
electromechanical data storage device that uses magnetic storage to store and retrieve digital
data using one or more rigid rapidly rotating platters coated with magnetic material. The platters
are paired with magnetic heads,
c) CD-ROM : A CD-ROM (/ˌsiːdiːˈrɒm/, compact disc read-only memory) is a pre-pressed optical
compact disc that contains data. Computers can read—but not write to or erase—CD-ROMs, i.e.
it is a type of read-only memory.
d) CD-R : CD-R ( COMPACT DISC - recordable) is a digital optical disc storage format. A CD-R disc is a
compact disc that can be written once and read arbitrarily many times.
e) CD-RW : CD-RW (Compact Disc-ReWritable) is a digital optical disc storage format introduced in
1997. A CD-RW compact disc (CD-RWs) can be written, read, erased, and re-written. CDRWs, as
opposed to CDs, require specialized readers that have sensitive laser optics.
f) Joystick : A joystick is an input device consisting of a stick that pivots on a base and reports its
angle or direction to the device it is controlling. A joystick, also known as the control column, is
the principal control device in the cockpit of many civilian and military aircraft, either as a center
stick or side-stick. It often has supplementary switches to control various aspects of the aircraft's
flight.
g) Sound card : A sound card (also known as an audio card) is an internal expansion card that
provides input and output of audio signals to and from a computer under control of computer
programs. The term sound card is also applied to external audio interfaces used for professional
audio applications.
h) Modem : is a hardware device that converts data into a format suitable for a transmission
medium so that it can be transmitted from one computer to another (historically along telephone
wires). A modem modulates one or more carrier wave signals to encode digital information for
transmission and demodulates signals to decode the transmitted information.
i) Display and display adapter : A plug-in card in a desktop computer that performs graphics
processing. Also commonly called a "graphics card" or "video card," modern display adapters use
the PCI Express interface, while earlier cards used PCI and AGP. The display adapter determines
the maximum resolution, refresh rate and number of colors that can be displayed, which the
monitor must also be able to support. Whereas, A display device is an output device for
presentation of information in visual[1] or tactile form (the latter used for example in tactile
electronic displays for blind people).[2] When the input information that is supplied has an
electrical signal the display is called an electronic display.
j) Mouse : A computer mouse is a hand-held pointing device that detects two-dimensional motion
relative to a surface. This motion is typically translated into the motion of a pointer on a display,
which allows a smooth control of the graphical user interface of a computer.
k) Keyboard : A computer keyboard is one of the primary input devices used with a computer.
Similar to an electric typewriter, a keyboard is composed of buttons that create letters, numbers,
and symbols, as well as perform other functions.
l) Computer cabinet : computer cabinet, is the enclosure that contains most of the components
of a personal computer (usually excluding the display, keyboard, and mouse). Cases are
usually constructed from steel (often SECC—steel, electrogalvanized, cold-rolled, coil),
aluminium and plastic.Other materials such as glass, wood, acrylic and even Lego bricks
have appeared in home-built cases.
m) UPS : An uninterruptible power supply or uninterruptible power source (UPS) is an electrical
apparatus that provides emergency power to a load when the input power source or mains
power fails. A UPS differs from an auxiliary or emergency power system or standby generator in
that it will provide near-instantaneous protection from input power interruptions, by supplying
energy stored in batteries, supercapacitors, or flywheels.