- Afghanistan
- Albania
- Algeria
- Andorra
- Angola
- Antigua Barbuda
- Argentina
- Armenia
- Australia
- Austria
- Azerbaijan
- Bahamas
- Bahrain
- Bangladesh
- Barbados
- Belaruss
- Belgium
- Belize
- Benin
- Bermuda
- Bhutan
- Bolivia
- Bosnia-Herzegovina
- Botswana
- Brazil
- Brunei
- Bulgaria
- Burkina Faso
- Burma(Myanmar)
- Burundi
- Cambodia
- Cameroon
- Canada
- Cape Verde
- Cayman Islands
- Centralafrican
- Chad
- Chile
- China
- Colombia
- Comoros
- Congo democratic
- Congo
- Costa Rica
- Cote d'Ivoire
- Croatia
- Cuba
- Cyprus
- Czech Republic
- Denmark
- Djibouti
- Dominica
- Dominican Republic
- Ecuador
- Egypt
- El Salvador
- Equatorial Guinea
- Eritrea
- Estonia
- Ethiopia
- Fiji
- Finland
- France
- French Guiana
- Gabon
- Gambia
- Géorgia
- Germany
- Ghana
- Greece
- Greenland
- Grenada
- Guadeloupe
- Guatemala
- Guinea
- Guinea Bissau
- Guyana
- Haïti
- Honduras
- Hong Kong
- Hungary
- Iceland
- India
- Indonesia
- Iran
- Iraq
- Ireland
- Israel
- Italy
- Jamaica
- Japan
- Jordan
- Kazakhstan
- Kenya
- Kiribati
- Kuweit
- Kyrgyzstan
- Laos
- Latvia
- Lebanon
- Lesotho
- Liberia
- Libya
- Liechtenstein
- Lithuania
- Luxembourg
- Macedonia
- Madagascar
- Malawi
- Malaysia
- Maldives
- Mali
- Malta
- Marshall Islands
- Mauricius
- Mauritania
- Mexico
- Micronesia
- Moldova
- Monaco
- Mongolia
- Montenegro
- Morocco
- Mozambique
- Namibia
- Nauru
- Nepal
- Netherlands/Holland
- New Caledonia
- New Zealand
- Nicaragua
- Niger
- Nigeria
- North Korea
- Norway
- Oman
- Pakistan
- Palau
- Palestine
- Panama
- Papua - New Guinea
- Paraguay
- Peru
- Philippines
- Poland
- Portugal
- Puerto Rico
- Qatar
- Reunion
- Romania
- Russia
- Rwanda
- Saint Kitts and Nevis
- Saint Lucia
- Saint Vincent
- San Marino
- São Tomé and Príncipe
- Saudi Arabia
- Senegal
- Serbia
- Seychelles
- Sierra Leone
- Singapore
- Slovakia
- Slovenia
- Solomon
- Somalia
- South Africa
- South Korea
- Spain
- Sri Lanka
- Sudan
- Suriname
- Swaziland
- Sweden
- Switzerland
- Syria
- Taiwan
- Tajikistan
- Tanzania
- Thaïland
- Togo
- Tonga
- Trinidad and Tobago
- Tunisia
- Turkey
- Turkmenistan
- Tuvalu
- Uganda
- Ukraine
- United Arab Emirates
- United-Kingdom
- United-States
- Uruguay
- Uzbekistan
- Vanuatu
- Venezuela
- Vietnam
- Western Sahara
- Yemen
- Zambia
- Zimbabwe
Sunday, 27 November 2011
All Countries Name List Of The World
All Types of C Language Programs List
- C Program For Circular Link list
- C Program For Double Link List
- C Program For Simple Link List
- C Program For Single Link List
- C Program of Priority Queue
- C Program of Circular Queue
- C Program for Double Ended Queue
- C Program of Simple Queue
- C Program For Incertion Sorting
- C Program For Bubble Sorting
- C Program For Selection Sorting
- C Program For Find Smallest Value In Array In Ds
- Program For Find Second Max Value In Array In Ds
- C Program For Find Max Value In Array
- C Program For Linear Searching
- C Program For Binary Searching
- C program for Find Transpose Using Array
- C program for Multipication Of Matrix Using Array
- C program for Find Matrix Substraction For Using A...
- C program for Find Matrix Addition Using Array
- C program for Find Sum Of Matrix Using Array
- C program for Print Value With Two Dimensional Arr...
- C program for Sum of array list with array and cal...
- C Program for Print Array List For Using Array
C Program For Circular Link list
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
struct list
{
int data;
struct list*next;
};
void main()
{
struct list*temp*,start,*node;
start=temp=node=null;
int ch;
clrscr();
do{
printf("1.add 2.display 3.exit");
scanf("%d",&ch);
if(ch == 1)
{
node(struct list*)malloc(size of(struct list));
if(start == null)
{
start node;
start->next=start;
start->pre=null;
}
else
{
temp = start;
while(temp->next!=start)
{
temp=temp->next;
}
temp->next=node;
node->next=start;
}
}
if(ch == 2)
{
for(temp=start;temp->data)
printf("%d",temp->data);
}
if(ch == 3)
{
for(temp=start;temp->next!=start;temp=temp->next)
printf("%d",temp->data);
}
if(ch == 4)
exit(0);
}while(1);
getch();
}
C Program For Double Link List
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
struct list
{
int data;
struct list*next,*pri;
};
void main()
{
struct list*temp,*start,*node;
start=node=temp=null;
int ch,pos;
clrscr();
do{
printf("1.add 2.create first node 3.create middle node 4.display 5.exit");
scanf("%d",&ch);
if(ch == 1)
{
node=(struct list*)malloc(size of struct list);
scanf("%d",&node->data);
if(start == null)
{
start = node;
start = next = null;
start = pre = null;
}
else
temp = start;
while(temp->next!null)
{
temp=temp->next;
}
}
if(ch == 2)
{
node=(struct list*)malloc(size of (struct list));
scamf("%d",&node->data);
start->pre=null;
start=next=null;
}
if(ch == 3)
{
printf("enter position");
scanf("%d",&pos);
node=(struct list*)malloc(size of(struct list));
scanf("%d",&node->data);
int e=0;
for(temp=start;temp!=null;temp=temp->next)
{
e++;
if(e == pos-1)
break:
}
temp->next->pre->node;
node->next=temp->next;
node->pre=temp;
temp->next=node;
}
if(ch == 4)
{
for(temp=start;temp!null;temp=temp->next)
printf("%d",temp->data);
}
if(ch == 5)
exit(0);
}while(1);
getch();
}
C Program For Simple Link List
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
struct list
{
int data;
struct list * netxt;
};
void main()
{
street list*node,*start,*temp;
start=node=temp=null;
int ch;
do{
printf("1.add 2.display 3.exit");
scanf("%d",& ch);
if(ch == 1)
{
node=(struct list*);
scanf("%d",&node->data);
if(start == null)
{
start = node;
start->next = null;
}
else
temp = start;
while(temp->next!=null)
{
temp= temp->next;
}
temp->next=node;
node->next=null;
}
if(ch == 2)
{
for(temp = start;temp!=null;temp->next)
{
printf("%d",temp->data);
}
}
if(ch == 3)
exit(0);
}while(1);
getch();
}
C Program For Single Link List
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
struct list
{
int data;
struct list * netxt;
};
void main()
{
street list*node,*start,*temp;
start=node=temp=null;
int ch;
do{
printf("1.add 2.display 3.exit");
scanf("%d",& ch);
if(ch == 1)
{
node=(struct list*);
scanf("%d",&node->data);
if(start == null)
{
start = node;
start->next = null;
}
else
temp = start;
while(temp->next!=null)
{
temp= temp->next;
}
temp->next=node;
node->next=null;
}
if(ch == 2)
{
for(temp = start;temp!=null;temp->next)
{
printf("%d",temp->data);
}
}
if(ch == 3)
exit(0);
}while(1);
getch();
}
C Program of Priority Queue
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
int queue[10],val,i,ch,pos,m,h;
for(i=0;i<=10;i++)
queue[i] = 0;
do{
printf("1.insert 2.delete 3.display 4.exit");
scanf("%d",& ch);
if(ch == 1)
{
printf("enter value");
scanf("%d" & val);
printf("enter position");
scanf("%d", & pos);
if(pos<9 && queue[pos] == 0)
queue[pos]=val;
else
printf("position is not valid");
}
if(ch == 2)
{
h=0;
for(i=0;i<=9;i++)
{
if(queue[i]>h)
{
h=queue[i];
m=1;
}
}
queue[m] = 0;
}
if(ch == 3)
{
for(i=0;i<=9;i++)
{
printf("%d" queue[i]);
}
}
if(ch == 4)
{
exit(0);
}
}while(1);
getch();
}
C Program of Circular Queue
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
int queue[10],front=1,rear=1,ch,val,i;
clrscr();
do{
printf("i.insert 2.delete 3.display 4.exit");
scanf("%d",& ch);
if(ch == 1)
{
printf("Enter the value");
scanf("%d", &val);
if(front == [rear+1]+6)
printf("queue is full");
else
if(front == 1 && rear == 1)
{
front =0;
rear =0;
queue[rear] = val;
}
else if(rear<5)
{
rear rear+1;
queue[rear] = val;
}
else if(rear == 5 && front != 0)
{
rear = 0;
queue[rear] =val;
}
if(ch == 2)
{
if(front<=rear)
printf("%d",queue[front++]);
else if(front < 5)
printf("%d",queue[front++]);
else
if(front == 5 && rear != 0)
front = 0;
else
printf("queue is empty");
}
if(ch == 3)
{
if(front <= rear)
{
for(i=front;i<=rear;i++)
printf("%d",queue[i]);
for(i=front;i<5;i++)
printf("%d",queue[i]);
}
}
if(ch == 4)
{
exit(0);
}
}while(1);
getch();
}
C Program for Double Ended Queue
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
int queue[10],front = -1,rear=1,ch,val,i;
clrscr();
do{
printf("1.add 2.delete 3.display 4.exit");
scanf("%d" & ch);
if(ch == 1)
{
scanf("%d", & val);
if(front == 1 && rear == 1)
{
front =0;
rear = 0;
queue[rear] = val;
}
else
if(rear<9)
{
queue[++rear] = val;
}
else
{
printf("queue is full");
}
}
if(ch == 2)
{
if(front<=rear)
printf("%d",queue[front+1]);
}
if(ch == 3)
{
for(i=front;i<=rear;i++)
printf("%d",queue[i]);
}
if(ch == 4)
{
exit(0);
}while(1)
getch();
}
C Program of Simple Queue
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
int queue[10],front=1,rear=1,ch,val,i;
clrscr();
do{
printf("\n 1.add 2.delete 3.display 4.exit");
scanf("%d",& ch);
if(ch == 1)
{
scanf("%d",& val);
if(front == -1 && rear == -1)
{
front =0;
rear =0;
queue[rear]=val;
}
else
if(rear<9)
{
queue[++rear]=val;
}
else
printf("queue is full");
}
if(ch == 2)
{
if(front<=rear)
{
printf("%d",queue[front++]);
}
else
printf("queue is empty");
}
if(ch == 3)
{
for(i=front;i<=rear;i++)
printf("%d",queue[i]);
}
if(ch == 4)
exit(0);
}while(1)
getch();
}
C Program For Incertion Sorting
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],i,j,temp;
clrscr();
for(i=1;i<10;i++)
{
printf("Enter number");
scanf("%d", & a[i])'
}
for(i=0;i<10;i++)
{
for(j=0;j<10;j++)
{
if(a[j]>a[j+1])
{
temp = a[j];
a[j] = a[j+1];
a[j+1] = temp;
}
}
}
for(i=0;i<10;i++)
printf("%d",a[i]);
getch();
}
C Program For Bubble Sorting
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],i,j,temp;
clrscr();
for(i=1;i<10;i++)
{
printf("Enter number");
scanf("%d", & a[i])'
}
for(i=0;i<10;i++)
{
for(j=0;j<10;j++)
{
if(a[j]>a[j+1])
{
temp = a[j];
a[j] = a[j+1];
a[j+1] = temp;
}
}
}
for(i=0;i<10;i++)
printf("%d",a[i]);
getch();
}
C Program For Selection Sorting
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],i,j,temp;
clrscr();
for(i=1;i<10;i++)
{
printf("Enter number");
scanf("%d", & a[i])'
}
for(i=0;i<10;i++)
{
for(j=0;j<10;j++)
{
if(a[j]>a[j+1])
{
temp = a[j];
a[j] = a[j+1];
a[j+1] = temp;
}
}
}
for(i=0;i<10;i++)
printf("%d",a[i]);
getch();
}
C Program For Find Smallest Value In Array In Ds
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5],i,m=0;
clrscr();
for(i=0;i<5;i++)
{
printf("enter value in array");
scanf("%d",&a[i]);
}
for(i=0;i<5;i++)
{
if(a[i]<m)
m=a[i];
}
printf("%d",m);
getch();
}
Program For Find Second Max Value In Array In Ds
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5],i,m=0,sm=0;
clrscr();
for(i=0;i<5;i++)
{
printf("enter value in array");
scanf("%d",&a[i]);
}
for(i=0;i<5;i++)
{
if(a[i]>m)
{
sm = m;
m = a[i];
}
if(a[i]>sm)
sm > a[i];
}
printf("second max value=%d",sm);
getch();
}
C Program For Find Max Value In Array
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5],i,m=0;
clrscr();
for(i=0;i<5;i++)
{
scanf("%d" &a[i]);
}
for(i=0;i<5;i++)
{
if(a[i]>m)
m=a[i]
}
printf("max=%d",m);
getch();
}
C Program For Linear Searching
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5],i,b,f=0;
clrscr();
for(i=0;i<5;i++)
{
scanf("%d",a[i]);
}
printf("enter value for found");
scanf("%d",&b);
for(i=0;i<5;i++)
{
if(a[i] == b)
{
f=1;
break:
}
}
if(f == 1)
printf("found");
else
printf("not found");
getch();
}
C Program For Binary Searching
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5],i,f=0,b,min,max,mid;
clrscr();
for(i=0;i<5:i++)
{
printf("enter number");
scamf("%d",&a[i]);
}
printf("enter search value");
scanf("%d",&b);
min=0;
max=4;
while(min<=max)
{
mid=(min+max)/2;
if(a[mid] <=b)
min=mind+f;
else
max=mid-j;
if(a[mid] == b)
f=1;
break:
}
if(f==1)
printf("FOUND");
else
printf("NOT FOUND");
getch();
}
Subscribe to:
Posts (Atom)