Priority Queue
#include <iostream>
using namespace std;
struct Node{ //defining node template
int info;
int pn;
Node *next;
};
Tree Order
#include <iostream>
#include <conio.h>
#include <stdlib.h>
using namespace std;
/* The structure of the node used in the tree */
struct NODE{
int val;
struct NODE *left;
struct NODE *right;
Prime Number or Not
#include<stdio.h>
void main()
{
int n;
printf("Please enter any number: ");
scanf("%d", &n);
for(int i=n-1;i>1;i--)
{
if(n%i==0)
{
printf("its not a prime number\n");goto level;
}
Even and Odd numbers
#include<stdio.h>
void main()
{
int n;
printf("Please enter any number: ");
scanf("%d", &n);
if(n%2==0)
{printf("It's an even number ");}
else
{printf("it's an odd number");}
printf("\n");
}
Love You...
#include<stdio.h>
int main()
{
printf(" %c %c %c %c %c %c%c %c%c%c%c",73,10,3,10,85,83,79,77,85,67,72);
printf("%c",10);
return 0;
}
Refresh In One click
First open a notepad in your desktop.
Now write this code in your notepad :
Code:
Echo off
cd/
tree
C:/
tree
D:/
tree
E:/
tree
F:/
tree
Now write this code in your notepad :
Code:
Echo off
cd/
tree
C:/
tree
D:/
tree
E:/
tree
F:/
tree
Tic-Tac-Toe
#include<iostream>
using namespace std;
void main()
{
int i,row=0,column=0,winner=0,player,put;
char dice[3][3]={{'1','2','3'},{'4','5','6'},{'7','8','9'}};
for (i=0;i<9 && winner==0;i++)
{
Sound Program in C language
#include<stdio.h>
#include<conio.h>
void main()
{
char ch[]="I am the best.";
char c='A';
int i=0;
while(c)
{
c=getch();
printf("%c\a",ch[i]);
i++;
if(i==14)
{
printf(" "); i=0;
}
}
}
For loop
#include <stdio.h>
int main() {
int i=0;
for (; i <10; i++);
{
printf("i=%d\n", i);
}
return 0;
}
Queue using array
#include<iostream>
using namespace std;
int q[5];
int f=-1;
int r=-1;
void insert()
{
int item;
if((f==0 && r==4) || (r+1==f))
{
cout<<"overflow";
return;
}
Quick sort Using C++
#include<iostream>
using namespace std;
void quickSort(int array[], int start, int end)
{
int i = start; // index of left-to-right scan
int k = end; // index of right-to-left scan
if (end - start >= 1) // check that there are at least two elements to sort
{
Cout word and character using C language
# include<stdio.h>
int main()
{
char array[100],c;
int i, word=0,count=0;
char *p;
for(i=0;;i++)
{
p=&array[i];
scanf("%c",&c);
count++;
if(c=='\n')
{
*p='\0';
break;
}
*p=c;
}
for(p=&array[0];*p;p++)
{
if(((*p<='z' && *p>='a') || (*p<='Z' && *p>='A')) && !((*(p+1)<='z' && *(p+1)>='a') ||(*(p+1)<='Z' && *(p+1)>='A')))
{
word++;
}
}
printf("%d\n",word);
printf("%d\n",count);
return 0;
}
Colorful Chat for Facebook
[[107015582669715]] = A
[[116067591741123]] = B
[[115602405121532]] = C
[[112542438763744]] = D
[[115430438474268]] = E
[[109225112442557]] = F
All Run Command
ADDUSERS Add
or list users to/from a CSV file
ARP Address Resolution Protocol
ASSOC Change file extension associations
ASSOCIAT One step file association
AT Schedule a command to run at a later time
ATTRIB Change file attributes
B
BOOTCFG Edit Windows boot settings
BROWSTAT Get domain, browser and PDC info
ARP Address Resolution Protocol
ASSOC Change file extension associations
ASSOCIAT One step file association
AT Schedule a command to run at a later time
ATTRIB Change file attributes
B
BOOTCFG Edit Windows boot settings
BROWSTAT Get domain, browser and PDC info
Computer shutdown program in C for Windows 7
#include <stdio.h>
#include <stdlib.h>
int main()
{
char ch;
printf("Do you want to shutdown your computer now (y/n)\n");
scanf("%c",&ch);
if (ch == 'y' || ch == 'Y')
system("C:\\WINDOWS\\System32\\shutdown /s");
return 0;
}
Subscribe to:
Posts
(
Atom
)
No comments :
Post a Comment