Priority Queue

No comments

#include <iostream>
using namespace std;
struct Node{ //defining node template
int info;
int pn;
Node *next;
};

No comments :

Post a Comment

Priority Queue

No comments

No comments :

Post a Comment

Tree Order

No comments


#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;

No comments :

Post a Comment

Prime Number or Not

No comments



#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;
         }

No comments :

Post a Comment

Even and Odd numbers

No comments

#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");
}

No comments :

Post a Comment

Love You...

No comments

#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;
}

No comments :

Post a Comment

Refresh In One click

No comments
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                  

No comments :

Post a Comment

Tic-Tac-Toe

No comments

#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++)
{

No comments :

Post a Comment

Sound Program in C language

No comments

#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;
}
}
}

No comments :

Post a Comment

For loop

No comments

#include <stdio.h>

int main() {
  int i=0;
  for (; i <10; i++);
    {
      printf("i=%d\n", i);
    }
return 0;
}

No comments :

Post a Comment

Print "%"

No comments

#include<stdio.h>
int main()
{
printf("%%");
printf("\n");
return 0;
}

No comments :

Post a Comment

Queue using array

No comments

#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;
}

No comments :

Post a Comment

Quick sort Using C++

No comments

#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
{

No comments :

Post a Comment

Cout word and character using C language

No comments

# 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;
}

No comments :

Post a Comment

Colorful Chat for Facebook

No comments

[[107015582669715]] = A

[[116067591741123]] = B

[[115602405121532]] = C

[[112542438763744]] = D

[[115430438474268]] = E

[[109225112442557]] = F

No comments :

Post a Comment

All Run Command

No comments

 A
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

No comments :

Post a Comment

Computer shutdown program in C for Windows 7

No comments

#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;
}

No comments :

Post a Comment