You are on page 1of 3

#include <stdio.h> #include <stdio.

h>
int main() { int main() {
char alphabet; int month;
printf("Enter an alphabet:"); int days;
scanf("%c",&alphabet); printf("Enter month: ");
switch(alphabet) scanf("%d",&month);
{ switch(month) {
case 'a':
printf("Alphabet a is a vowel.\n"); case 4:
break; case 6:
case 'e': case 9:
printf("Alphabet e is a vowel.\n"); case 11:
break; days=30;
case 'i': break;
printf("Alphabet i is a vowel.\n"); case 1:
break; case 3:
case 'o': case 5:
printf("Alphabet o is a vowel.\n"); case 7:
break; case 8:
case 'u': case 10:
printf("Alphabet u is a vowel.\n"); case 12:
break; days=31;
default: break;
printf("You entered a consonant.\n");
break; } case 2:
return 0; } days=28;
------- break;
#include<stdio.h>
int main() default:
{ int ch1,ch2; days=0;
printf("H/h for head, T/t for tail\n"); break;
printf("Enter first choice-"); }
scanf("%c",&ch1); if(days)
fflush(stdin); printf("Number of days in %d month is:
printf("Enter second choice-"); %d\n",month,days);
scanf("%c",&ch2); else
switch(ch1) { printf("You have entered an invalid
case 'h': month!!!\n");
case 'H':
switch(ch2) return 0;
{ }
case 'h': -----
case 'H': #include <stdio.h>
printf("2 Heads"); int main()
break; { int number;
default: printf("Enter a positive integer number: ");
printf("Head and Tail"); scanf("%d",&number);
} switch(number%2) //this will return either 0 or 1
break; {
default: case 0:
switch(ch2) printf("%d is an EVEN number.\n",number);
{ case 'h': break;
case 'H': case 1:
printf("Tail and Head"); printf("%d is an ODD number.\n",number);
break; break;
default: }
printf("2 Tails"); } return 0;
} return 0; } }
#include <stdio.h> #include <stdio.h>
int main() void main(void)
{ double n1, n2, n3; { int ID;
printf("Enter three numbers: "); int pass;
scanf("%lf %lf %lf", &n1, &n2, &n3); printf("Plese Enter Your ID: ");
if (n1>=n2) { scanf("%d",&ID);
if(n1>=n3) printf("Enter your password: ");
printf("%.2lf is the largest number.", n1); scanf("%d",&pass);
else switch(ID)
printf("%.2lf is the largest number.", n3); {
} else { case 470:
if(n2>=n3) printf("Welcome Mahmoud");
printf("%.2lf is the largest number.", n2); break;
else switch(pass)
printf("%.2lf is the largest number.",n3); {
} return 0; } case 602:
------ printf("Welcome Mahmoud");
#include <stdio.h> }
int main() { default :
int n, i, flag = 0; printf("incorrect password");
printf("Enter a positive integer: "); break;
scanf("%d", &n); } return 0;
for(i = 2; i <= n/2; ++i) }
{ if(n%i == 0) #include<stdio.h>
{ flag = 1; int main()
break; } {
} if (n == 1) int a,b;
{ printf("1 is neither a prime nor a composite number."); printf("1.School of Computer Science\n");
} else { printf("2.School of Business\n");
if (flag == 0) printf("3.School of Engineering\n");
printf("%d is a prime number.", n); printf("make your selection\n");
else scanf("%d",&a);
printf("%d is not a prime number.", n); switch (a)
} return 0; } { case 1: printf("Available Departments\n"
#include <stdio.h> printf("1.Department of commerce\n");
int main() printf("2.Department of purchasing\n");
{ printf("Make your selection.\n");
int year; scanf("%d",&b);
printf("Enter a year: "); break;
scanf("%d",&year); case 2:
printf("Available Departments\n"
if(year%4 == 0) printf("1.Department of commerce\n");
{ printf("2.Department of purchasing\n");
if( year%100 == 0) printf("Make your selection.\n");
{ scanf("%d",&b);
// year is divisible by 400, hence the year is a leap year switch(b)
if ( year%400 == 0) { case 1:
printf("%d is a leap year.", year); // code to be executed if b = 1;
else printf("You chose Department of commerce\n" );
printf("%d is not a leap year.", year); break;
} case 2:
else // code to be executed if b = 2;
printf("%d is a leap year.", year ); printf("You chose Department of purchasing" );
} break;
else }
printf("%d is not a leap year.", year); break;
return 0; }
} }
1. Dynamic Ram Uses lower standard voltage (1.8 V)
Older technology, popular until the mid-1990s 6. DDR3 SDRAM
Used for main memory
DDR3 Synchronous Dynamic RAM
DRAM gradually discharges energy so it must be constantly
refreshed with pulses of electricity in order to maintain the DDR3 SDRAM expands memory bandwidth by doubling the
store ate in the chip clock rate of DDR2
2. Static RAM Consumes less power than DDR2 (1.5 V)
Requires constant power to function Generate less heat
Often used for cache memory Runs at higher clock speeds (up to 800 MHz)
Uses lower power consumption
Much faster than DRAM
Connector has 240 pins
More expensive than DRAM 7. DDR4 SDRAM
3. SDRAM DDR4 Synchronous Dynamic RAM
Synchronous Dynamic RAM DDR4 SDRAM quadruples DDR3 maximum storage capacity
DRAM that operates in synchronization with the memory bus Consumes less power than DDR3 (1.2 V)
Able to process overlapping instructions in parallel - e.g It can Runs at higher clock speeds (up to 1600 MHz)
process a read before a write has been completed
Higher transfer rates Connector has 288 pins
4. DDR SDRAM Available with advanced error correction features such as
Double Date Rate Synchronous Dynamic RAM error-correcting code memory (ECC memory) to detect
DDR SDRAM transfer data twice as fast as SDRAM multiple bit errors
Able to support two write and two reads per CPU clock cycle 8. GDDR SDRAM
Connector has 184 pins and a single notch
GDDR Synchronous Dynamic RAM
Uses lower standard voltage (2.5 V)
Family: DDR2, DDR3, DDR4 The “G” stands for graphics
5. DDR2 SDRAM RAM specifically designed for video graphics
DDR2 Synchronous Dynamic RAM Used in conjunction with a dedicated GPU
DDR2 SDRAM also transfer data twice as fast as SDRAM Family: GDDR, GDDR2, GDDR3, GDDR4, GDDR5
Runs at higher clock speeds than DDR (553 MHz vs. DDR at Each family member lowers power consumption
200 MHz)
Improves performance by decreasing noise and crosstalk GDDR SDRAM processes massive amounts of data but not
between signal wires necessarily at the fastest speeds
Connector has 240 pins

Memory Modules
Early computers had RAM installed on the motherboard as
individual chips. The individual memory chips, called dual inline
package (DIP) chips, were difficult to install and often became
loose. To solve this problem, designers soldered the memory
chips to a circuit board to create a memory module which
would then be placed into a memory slot on the motherboard.
The different types of memory modules are described in Figure
1. Note: Memory modules can be single-sided or double-sided.
Single-sided memory modules contain RAM on only one side
of the module. Double-sided memory modules contain RAM on
both sides. The speed of memory has a direct impact on how
much data a processor can process in a given period of time.
As processor speed increases, memory speed must also
increase. Memory throughput has also been increased through
multichannel technology. Standard RAM is single channel,
meaning that all of the RAM slots are addressed at the same
time. Dual channel RAM adds a second channel to be able to
access a second module at the same time. Triple channel
technology provides another channel so that three modules
can be accessed at the same time. The fastest memory is
typically static RAM (SRAM) which is cache memory for storing
the most recently used data and instructions by the CPU.
SRAM provides the processor with faster access to the data
than retrieving it from the slower dynamic RAM (DRAM), or
main memory. The three most common types of cache
memory are described in Figure 2. Memory errors occur when
the data is not stored correctly in the chips. The computer uses
different methods to detect and correct data errors in memory.

You might also like