rajivnewid
BAN USER#include<stdio.h>
void main()
{
int a[10],i,k=1,l;
printf("\nenter elements");
for(i=0;i<10;i++)
scanf("%d",&a[i]);
i=0;
if(a[i]>=0)
for(i=0;i<9;i++)
if(a[i]>a[i+1])
{
k=0;
break;
}
else
k=1;
else
printf("Not a set");
if(k==0)
printf("it is not a set");
else
printf("SET");
}
void rotate(int a[3][3])
{
int b[3][3],i,j;
for(i=0;i<3;i++)
for(j=0;j<3;j++)
b[j][2-i]=a[i][j];
for(i=0;i<3;i++)
for(j=0;j<3;j++)
a[i][j]=b[i][j];
}
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
void main()
{
int len,sum=0,i,j,k=0;
char *a,b[20];
printf("\nEnter string");
scanf("%s",b);
for(i=0;i<strlen(b);i=i+2)
{
sum=sum+b[i+1]-'0';
}
sum=sum+(strlen(b)/2);
a=(char *)malloc(sizeof(char)*sum+1);
for(i=0;i<strlen(b);i=i+2)
{
len=b[i+1]-'0';
a[k++]=b[i];
while(len---1)
a[k++]=b[i];
}
printf("%s",a);
}
struct node
{
int data;
struct node *left,*right;
}*root=NULL;
int h1;
typedef struct node NODE;
//============================================
//h1 is global variable that will be accessed inside main and will contain height of tree.
void height(NODE *ptr,int h)
{
if(ptr->left!=NULL)
height(ptr->left,h+1);
if(ptr->right!=NULL)
height(ptr->right,h+1);
if(ptr->left==NULL && ptr->right==NULL && h%2==1)
h1=h;
}
- rajivnewid March 07, 2013