Saturday, September 12, 2009

Draw A Diamond With Astericks(*) - : for cs201


// Justin C. Miller

// 3-27-2001
// made on: Unix Lab g++ compiler
// Title : creating a diamond shape
// Description: simple diamond shape using * 's

#include
#include

int main()
{
int i , j ;
int maxWidth = 11 ; // max width of the diamond
// top half of diamond
for(i = 0 ; i < (maxWidth/2 + 1) ; i++)
{
for(j = i ; j < (maxWidth/2) ; j++)
// used to align, putting in spaces
cout << " " ;
for(j = 1 ; j <= (i*2 + 1) ; j++)
// puts in the actual astericks
cout << "*" ;
cout <<>
}

// bottom half of diamond
for(i = (maxWidth/2) ; i > 0 ; i--){
for(j = (maxWidth/2 + 1) ; j > i ; j--)
// used to align, putting in spaces
cout << " " ;
for(j = (i*2 - 1) ; j > 0 ; j--) // puts in the actual astericks
cout << "*" ;
cout <<>
}

cout <<>

// PUTTING THE 2 HALVES TOGETHER!!!
for(i = 0 ; i <>
if(i <= (maxWidth/2)){
for(j = i ; j < (maxWidth/2) ; j++)
// used to align, putting in spaces
cout << " " ;
for(j =
1 ; j <= (i*2 + 1) ; j++) // puts in the actual astericks
cout << "*" ;
cout <<>
}
else{
for(j = (maxWidth/2 + 1) ; j > (maxWidth-i) ; j--)
// used to align, putting in spaces
cout << " " ;
for(j = ((maxWidth-i)*2 - 1) ; j > 0 ; j--) // puts in the actual astericks
cout << "*" ;
cout <<>
}

}

return 0 ;
}



Thursday, September 3, 2009

Program to enter an integer and print its total

Program to enter an integer and print its total value based on the formula'
x - 1/3!x^3 + 1/5!x^5 - 1/7!x^7 + 1/9!x^9':-

#include
#include
#include
int main()
{
clrscr();
float factorial=1;
float num,tot,term,total;
int i,n=20,index,j=1;
cout << "Enter a single-digit integer : \n"; cin>>num;
tot=num;
total=num;
for(i=2,index=3;i<=n;i++,index+=2)
{
for(j=1,factorial=1;j<=index;j++)
factorial*=j;
tot=tot*pow((double)(-1),(double)(2*i-1))*num*num;
term=tot/factorial;
total+=term;
}
cout << "Total = " << total << endl;
getch();
return 0;
}

Monday, July 6, 2009

Hide Your harddrives

If you have sensitive or important data stored on a particular disk drive that you don’t want anyone to see, a great way to hide it is to remove the drive letter assigned to a particular mounted volume. With Windows XP, you can achieve this easily using nothing more than the Command Prompt. Here's how:

- Click Start -> Run (This brings up the Run dialog box)
-Type cmd and press Enter (This brings up the Windows Command Prompt)
- Type diskpart in the command prompt and press Enter (This launches the Diskpart utility within the Command Prompt window)
- Now type list volume (This displays a list of all mounted volumes on your computer and their associated drive letters)


- Using the above picture as reference, if, for example, you would like to hide drive E, type select volume 2
- Now type remove letter E (Note: This sometime requires a reboot)
Diskpart will now remove the drive letter. The drive will no longer be available via Windows Explorer or My Computer.
Don’t worry though, your data remains safe!Now, should you want to unhide the drive and make it accessible again, just repeat the above process.
But instead of typing remove letter E, type assign letter E

Merge Sort C++ Source Code

#include
#include

int main () {
ifstream f1, f2;
ofstream f3;
int i,j;

f1.open("n1");
f2.open("n2");
f3.open("n1n2");

f1 >> i;
f2 >> j;
while (f1 && f2) {
if (i <>> i;
}
}
else {
while (j <= i && f2 && f3) { f3 <<>> j;
}
}
}
while (f1) {
f3 <<>> i;
}
while (f2) {
f3 <<>> j;
}
return (0);
}

Saturday, July 4, 2009

CS601 3, July Paper

Hi friends this is the paper os CS601, Try to solve it byyourself. It will be better for you.

1. Trailer is only added at _______ layer of OSI Model.
2.Data Link layer deals with mechanical and electrical specification of transmission medium
and inteface.
True / False
4. The______ layer changes bits into electromagnetic signal.
5. BLAST is more faster than X-Modem
True / False
6. Fourier transfomrs tells us that any digital signal can be decomposed into infinite number of periodic.
True / False
7. We need _______ to decompose a composite signal into its component.
8. The invention of the level at 1 bit is called____.
9._____ Require more bandwidth.
10. FTTC stands for.
11. In cyclic redundancy checking, what is the CRC________.
12. Which error detection method can detect a bust error_____
13. The sum of the checksum data at the receiver is _______ if there are no error.
14. Addressing is not needed in __________
15. Repeater is an amplifier, not regenrator
True / False
16. In FDDI , Token pase to used as access method.
True / False

Short question
1. What is traditional Modems?
2. What are light sources?
3. Different Physical layers?
4 . What is transmission Impairments?
5. Line Discipline.



Soon we will provide cs201 paper and many more things.

Thursday, July 2, 2009

Fibonacci Number C++ Program

#include
// sequence is 0, 1, 1, 2, 3, 5, 8, 13, ...
int fib (int i) {
int pred, result, temp;
pred = 1; result = 0;
while (i > 0)
{
temp = pred + result;
result = pred;
pred = temp;
i = i-1;
}
return(result);
}
int main ()
{
int n;
cout << "Enter a natural number: ";
cin >> n;
while (n < 0)
{
cout << "Please re-enter: ";
cin >> n;
}