Saturday, April 17, 2021

Some awesome C Programming PDF books can be downloaded!

1. C The Complete Reference 4th Edition by Herbert Schildt. >>Download

2. C Language Tutorial by Gordon Dodrill, Coronado Enterprises.>>Download

3. TURBO C: Users Guide IBM Version PC, AT, XT & True Compatibles.>>Download

4. The C Programming Language 2nd Edition book by Brian Kernighan and Dennis Ritchie.>>Download

5. Expert C Programming Deep C Secrets By Peter van der Linden.>>Download

6. Problem Solving in Data Structures and Algorithms Using C First Edition by Hemant Jain.>>Download

7. Learn to Code with C Program with the World most Popular Language on your Raspberry Pi written by Simon Long.>>Download

8. C Programming-Absolute Beginner guide by Greg Perry and Dean Miller.>>Download 

Tuesday, April 13, 2021

20.59. Write a program that swaps two numbers.

#include<stdio.h>
#inctude<conio.h>
void swap(int *a, int *b)
{
int temp;
tamp=*a;
*a=*b;
*b=temp;
}
void main ()
{
int a,b;
clrscr();
printf("a=   ") ;
scanf("%d", &a);
printf("b=   ");
scanf("%d", &b);
swap (&a, &b) ;
printf("After swap:  \n");
printf("a=  %d\n", a);
printf("b=  %d\n", b);
getch ();
}

20.58. Write a program that create, insert, and delete a two-way link list.

#include<stdio.h>
#include<conio.h>
include<stdlib.h>
struct node
{
int info;
struct node *next, *prev;
};
strict node *makenode (int n)
{
struct node t;
t=(struct node *)alloc(sizeof (struct node));
t->info=r;
t->next-NULL;
t->prev=NULL;
return t;
}
void makelist (struct node *list)
{
int i,n,num;
printf("How many node: "):
scanf ("%d", &n);
for (i=1; i<-n; i++)
{
scanf ("%d", &num);
list->next=makanode(num);
list->next->prev=list;
list=list->next;
}
}
void print list (struct node *list)
{
printf ("\list contains: \n");
while(list->rext!=NULL)
{
printf("%5d",list-next->info);
list=list->next;
}
}
int countlist (struct nede *list)
{
int count=0;
while (list->next!-NULL)
{
count++;
list=list->next;
}
return count;
}
void insert first (struct node *list)
{
int n;
struct node *t;
printf ("Enter any number to insert first: ";
scanf("%d", &n);
t=makenode(n);
list->next->prev=t;
t->prev=list;
t->next=list->next;
list->next=t;
}
void deletefirst (struct node *list)
{
struct node *t;
t=list->next->next;
free (list->next);
t->prev=list;
list->next=t;
}
void insert middle (struct node *list)
{
int i,n,count, p;
struct node *t;
count countlist(list);
printf("Enter any position to insert: ") ;
scanf ("%d", &p);
If (p<1 || p>count+1)
printf("Insert is impossible.");
else
{
for (i=1; i<p; i++) 
list=list->next;
printf("Enter any number to insert middle:”);
scanf ("%d", &n);
t=makenode(n);
list->next->prev=t;
t->prev=list;
t->next=list->next;
list->next=t;
}
}
void deletemiddle (struct node list)
{
struct node *t; 
int count, i,p;
count count list (list);
printf("Enter any position to delete middle: ");
scanf("%d", &p);
If (p<1 || p>count)
printf("Delete is impossible.");
else
{
for (i=1; i<p; i++)
list=list->next;
t=list->next->ext;
free list->next);
t->prev=list;
list->next=t;
}
}
void insertlast (struct node *list)
{
int n;
struct node *t;
printf("Enter any number to insert last: ";
scanf ("%d",&n);
t=makenode (n):
while (list->next!=NULL)
list-list->rext;
t->prev=list;
list->next=t;
}
void deletelast(struct node list)} 1
{
while (list->next->next!=NULL)
list=list->next;
free (list->next);
list->next=NULL;
}
void main ()
{
int n, choice;
struct node *list;
clrscr();
list=(struct node *)malloc(sizeof (struct nod makelist (1ist);
do
{
clrscr ():
print list (list);
printf("\r.Enter your cliocie from 1 to 7.");
printf("\r1. Insert First.");
printf("\r2. Insert Middle.");
printf("\r3. Insert Last.");
printf("\r4. Delete First.");
printf("\r5. Delete Middle.");
printf("\r6. Delete Last.");
printf("\r7. Exit\n");
scanf ("%d", &choice); 
switch (chcice)
{
case 1:
insertfirst (list);
break;
case 2:
insertmiddle (list);
break:
case 3:
insertlast (list);
break;
case 4:
deletefirst (list):
break;
case 5:
deletemiddle (list);
break;
case 6:
deletelist (list);
break:
case 7:
printf("\nThe program is now exit.");
printf("\nPress any key to continue”);
break;
default:
printf("\nYour choice out of range. ");
printf("\nPlease try again.");
print list (list);
getch ();
}
while(choice! =7);
}
 

 

Monday, April 12, 2021

20.57. Write a program that create, insert, and delete a one-way link list.

#include<stdio.h>
#include<conio.h>
include<stdlib.h>
struct node
{
int info;
struct node *next;
};
struct node *makenode (int n)
{
struct node *t;
t=(struct node *) malloc(sizeof (struct node));
t->info=n;
t->next=NULL;
return t;
}
void makelist (struct node *list
{
int i, n, rum;
printf("How many node: "); 
scanf ("%d", &n, ;
For (i=1; i<=n; i++)
{
scanf("%d",&num);
list->next=>namenode(num);
list=list->next;
}
}
void printlist (struct node *list)
{
printf("\nList contains: \n");
while (list->next!=NULL)
{
printf("%5d",list->next->info);
list=list->next;
}
}
int countlist(struct node *list)
{
int count=0;
while(list->next!=NULL)
{
count++;
list=list->next;
}
return count;
}
void insertfirst (struct node *list)
{
int n;
struct node *t;
printf("\nEnter any number to insert first: ");
scanf ("%d", &n.);
t=makenocie (n);
t->next-list->next;
list->next=3t;
}
void deletefirst (struct node list)
{
struct node *t;
t=list->next->next;
free (list->next); 
list-next%3Dt%;
}
Void insertlast (st cuct node list)
{
int n;
struct node *t;
printf("\nEnter any number to insert last: ");
scanf ("%d", &r):
while (list->next!=NULL) List=list->next;
1ist->next-makenode (n);
}
void deletelast (struct node list)
{
while (list->next->next!-NULL) 
list=list->next; 
free(list->next);
list->next = NULL;
}
void insertmiddle (struct node *list)
{
int n, 
count,i,p; 
struct node t;
count->count list (list);
printf("\nEnter any position to insert: ");
scanf("%d", &p); 
if(p<1 11 p>count+1)
printf("Insert is impossible";
else
{
for (i=1; i<p; i++) 
1ist=list->next;
printf("after any number to insert middle”);
scanf ("%d", &n); 
t=make node (n);
t->next->list->next;
list->next=t;
}
}
void delete middle (struct node *list)
{
int count, i,p;
struct node *t;
Count=countiist (1ist);
printf("\nEnter any position to delete: ");
scanf("%d", &p); 
if (p<1 || p>count)
printf("Celete is impossible"},
alse
{
for (i-1; i<p; 1++)
1ist=list->next;
t=list->next->next;
free (list->next);
list->next=t;
}
}
void main()
{
int n, choice;
struct node *list:
int=(struct node *) malloc(sizeof (struct node));
makelist (list):
do
{
clrscr ():
print list (list);
printf("\r.Enter your cliocie from 1 to 7.");
printf("\r1. Insert First.");
printf("\r2. Insert Middle.");
printf("\r3. Insert Last.");
printf("\r4. Delete First.");
printf("\r5. Delete Middle.");
printf("\r6. Delete Last.");
printf("\r7. Exit\n");
scanf ("%d", &choice); 
switch (chcice)
{
case 1:
insertfirst (list);
break;
case 2:
insertmiddle (list);
break:
case 3:
insertlast (list);
break;
case 4:
deletefirst (list):
break;
case 5:
deletemiddle (list);
break;
case 6:
deletelist (list);
break:
case 7:
printf("\nThe program is now exit.");
printf("\nPress any key to continue”);
break;
default:
printf("\nYour choice out of range. ");
printf("\nPlease try again.");
print list (list);
getch ();
}
while(choice! =7);
}




20.56. Write a program that create a link list to store some double numbers.

#include<stdio.h>
#include<conio.h>
include<stdlib.h>
struct node
{
double info;
struct node *next;
};
struct node *makenode (
double n)
{
struct node *t;
t=(struct node *) malloc(sizeof (struct node));
t->info=n;
t->next=NULL;
return t;
}
void makelist (struct node *list)
{
int i, n;
double num;
printf("How many node: "); 
scanf ("%d", &n, ;
For (i=1; i<=n; i++)
{
scanf("%lf",&num);
list->next namenode (num);
list=list->next;
}
}
void printlist (struct node *list)
{
printf("\nList contains: \n");
while (list->next!=NULL)
{
printf("%lf",list->next->info);
list=list->next;
}
}
void main()
{
struct node *start;
start=(struct node *)malloc(sizeof (struct node));,
clrscr();
make list (start);
printlist (start);
getch ();
}
 

20.55. Write a program that create a link list to store some long numbers.

#include<stdio.h>
#include<conio.h>
include<stdlib.h>
struct node
{
long info;
struct node *next;
};
struct node *makenode (
long n)
{
struct node *t;
t=(struct node *) malloc(sizeof (struct node));
t->info=n;
t->next=NULL;
return t;
}
void makelist (struct node *list)
{
int i, n;
long num;
printf("How many node: "); 
scanf ("%d", &n, ;
For (i=1; i<=n; i++)
{
scanf("%ld",&num);
list->next namenode (num);
list=list->next;
}
}
void printlist (struct node *list)
{
printf("\nList contains: \n");
while (list->next!=NULL)
{
printf("%ld",list->next->info);
list=list->next;
}
}
void main()
{
struct node *start;
start=(struct node *)malloc(sizeof (struct node));,
clrscr();
make list (start);
printlist (start);
getch ();
}
 

20.54. Write a program that create a link list to store some character.

#include<stdio.h>
#include<conio.h>
include<stdlib.h>
struct node
{
char info;
struct node *next;
};
struct node *makenode (
char n)
{
struct node *t;
t=(struct node *) malloc(sizeof (struct node));
t->info=n;
t->next=NULL;
return t;
}
void makelist (struct node *list
{
int i, n;
char num;
printf("How many node: "); 
scanf ("d", &n, ;
For (i=1; i<=n; i++)
{
scanf("%d",&num);
list->next namenode (num);
list=list->next;
}
}
void printlist (struct node *list)
{
printf("\nList contains: \n");
while (list->next!=NULL)
{
printf("%c",list->next->info);
list=list->next;
}
}
void main()
{
struct node *start;
start=(struct node *)malloc(sizeof (struct node));,
clrscr();
make list (start);
printlist (start);
getch ();
}
 

20.53. Write a program that create a link list to store some integer numbers.

#include<stdio.h>
#include<conio.h>
include<stdlib.h>
struct node
{
int info;
struct node *next;
};
struct node *makenode (int n)
{
struct node *t;
t= (struct node *) malloc(sizeof (struct node));
t->info=n;
t->next=NULL;
return t;
}
void makelist (struct node *list
{
int i, n, rum;
printf("How many node: "); scanf ("d", &n, ;
For (i=1; i<=n; i++)
{
scanf("%d",&num);
list->next namenode (num);
list=list->next;
}
}
void printlist (struct node *list)
{
printf("\nList contains: \n");
while (list->next!=NULL)
{
printf("%5d",list->next->info);
list=list->next;
}
}
void main()
{
struct node *start;
start= (struct node *)malloc(sizeof (struct node));,
clrscr();
make list (start);
printlist (start);
getch ();
}
 

Saturday, April 10, 2021

20.52. Write a program that read and display some students name, roll and mark.

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>  
struct student 
{
char name [30] 
int roll,mark;
};
void main()
{
struct student *a;
int i,j,n;
printf("\How many student: ");
scanf("%d, &n);
a=(struct *)malloc(sizeof(struct student)*n);
for(i=0;i<n;i++)
{
printf("Enter Name: ");
scanf("%s,&(a+i)->name);
printf("Enter Roll: ");
scanf("%s,&(a+i)->roll);
printf("Enter Mark: ");
scanf("%s,&(a+i)->mark);
}
printf("\name Roll Mark");
printf("\----- ----- -----");
for(i=0;i<n;i++)
printf("\n%-10s %4d %4d", (a+i)->name, (a+i)->roll, (a+i)->mark); 
getch();
}

20.51. Write a program that read and display any students name, roll, mark.

#include<stdio.h>
#include conio.h>
#include<stdlib.h>  
struct student 
{
char name [30] 
int roll,mark;
};
void main()
{
struct student *a, temp;
int i,j,n;
a=(struct *)malloc(sizeof(struct student));
printf("Enter Name: ");
scanf("%s,a->name);
printf("Enter Roll: ");
scanf("%s,a->roll);
printf("Enter Mark: ");
scanf("%s,a->mark);
}
printf("Name: %s Roll: %d  Mark: %d",a->name,a->roll,a->mark); 
getch();
}

20.50. Write a program that multiplies two matrices.

#include<stdio.h>

#include<conio.h>

#include<stdlib.h>  
void main()

int i, j, rl, cl, r2, c2, *a[10][10], 
*b[10] [10], *c[10] [10];

clrscr ();

for(i=0; i<10; i++)
{
a[i]=(int *)malloc(sizeof(char)*10);
b[i]=(int *)malloc(sizeof(char)*10);
c[i]=(int *)malloc(sizeof(char)*10);
}

printf ("How many row in A: "); 
scanf("%d", &rl); 
printf ("How many column in A: ");
scanf ("%d", & cl);


for (i=0; i<rl; i++)
for (j=0; j<cl; j++) 
scanf ("%d", (*(a+i)+j);
printf ("How many row in A: "); 
scanf("%d", &r2); 
printf ("How many column in A: ");
scanf ("%d", & c2);

for (i=0; i<r2; i++)
for (j=0; j<c2; j++) 
scanf ("%d", (*(b+i)+j);

if(c1==c2)

{
for (i=0; i<r1; i++)
for (j=0; <c2; j++) 
{

*(*d(d+i)+j)=0;
for(k=0;k<c1;k++)
*(*(d+i)+j)=*(*(d+i)+j)+*(*a+i)+k)**(*(b(+k)+j)

}

printf ("The multiplication of A and B is: ");
for (i=0; i<rl; i++) 
{
for (j=0; j<c2; j++)
printf ("%4d", *(*d+i)+j));
printf("\n");
}
}
else
printf("\nThe multiplication of A and B is impossible.");
getch();
}

20.49. Write a program that adds two matrices.

#include<stdio.h>
#include conio.h>  
void main()
{
int i, j, rl, cl, r2, c2, *a[10][10], *b[10] [10], *c[10] [10];
for(i=0; i<10; i++)
{
a[i]=(int *)malloc(sizeof(char)*10);
b[i]=(int *)malloc(sizeof(char)*10);
c[i]=(int *)malloc(sizeof(char)*10);
}
clrscr ();
printf ("How many row in A: "); 
scanf("%d", &rl); 
printf ("How many column in A: ");
scaní ("%d", &cl);
for i=0; i<rl; i++)
for (j=0; j<cl; j++) 
scanf ("&d", (*a(a+i)+j));
printf("How many row in A: ");
scanf("%d", &r2);
printf ("How many column in A: "); 
scanf("%d", &c2);
for (i=0; i<r2; i++)
for (j=0; j<c2; j++) 
scanf("%d",&b[i][j]);
if (r1==r2 && cl==c2)
{
for (i=0; i<rl; i++) 
for (j=0; j<cl; j++)
*c[i] [j]=
*a[i] [j] +*b[i] [j];
printf("\nThe sum of A and B is: \n"); 
for (i=0; i<r1; i++)
for (j=0; j<cl; j++) 
printf ("%4d", *(*(c+i)+j));
printf("\n");
}
else
printf("\nThe sum of A and B is impossible.");
getch();
}

20.48. Write a program that read and display a matrix.

#include<stdio.h> 
#include<conio.h>
void main ()
{
int i, j,r,c, *a[10];
clrscr();
for(i=0;i<10;i++)
st=(char *)malloc(sizeof(char)*100);
printf ("How many row: "); 
scanf ("%d", &r);
printf ("How many column: ");
scanf ("%d",&c);
for (i=0; i<r; i++)
for (j=0; j<c; j++)
scanf ("%d", &a[i][j]);
for (i=0; i<r; i++) 
{
for (j=0; j<c; j++) 
printf("%4d", *(*(a+i)+j)); 
printf("\n");
}
getch ();
}

20.47. Write a program that read any hexadecimal number and display equivalent decimal number.

#include<stdio.h>
#include<conio.h> 
#include<string.h>
void main ()
{
char *st;
int i,n,l;
clrscr();
st=(char *)malloc(sizeof(char)*100);
printf ("Enter any Hexadecimal number: ");
scanf("%s",st);
n=0;
l=strlen(st);
for(i=0; i<1; i++)
if(*st[i]>='0' && *st[i]<='9'
n=n*16+st[i]-48;
else if(*st[i]>='A' && *st[i]<='F'
n=n*16+st[i]-55;
else if(*st[i]>='a' && *st[i]<='f'
n=n*16+*st[i]-87;
printf("Eqivalent decimal number is: %ld",n);
getch ();
}

20.46. Write a program that read any octal number and display equivalent decimal number.

#include<stdio.h>
#include<conio.h> 
#include<string.h>
void main ()
{
char *st;
int i,n,l;
clrscr();
st=(char *)malloc(sizeof(char)*100);
printf ("Enter any octal number: ");
scanf("%s",st);
n=0;
l=strlen(st);
for(i=0; i<1; i++)
n=n*8+*(st+i)-48;
printf("Eqivalent decimal numberis: %ld",n);
getch ();
}

20.45. Write a program that read any binary number and display equivalent decimal number.

#include<stdio.h>
#include<conio.h> 
#include<string.h>
void main ()
{
char *st;
int i,n,l;
clrscr();
st=(char *)malloc(sizeof(char)*100);
printf ("Enter any binary number: ");
scanf("%s",st);
n=0;
l=strlen(st);
for(i=0; i<1; i++)
n=n*2+st[i]-48;
printf("Eqivalent decimal numberis: %ld",n);
getch ();
}

20.44. Write a program that read an array of string and display in alphabetic order (without case sensitive).

#include<stdio.h>
#include<conio.h> 
#include<string.h>
void main () 
{
char *st[40] [100],temp[40];
int i,n, outer, inner;
for (i=0; i<100; i++)
st[i]=(char *)malloc(sizeof(char)*100);
clrscr ();
printf("How many word”);
scanf("%d\n", &n);
for (i=0; i<n; i++)
gets (st[i]);
Eor (outer=n-1; outer>=0; outer--)
for (inner=0; inner<outer; inner++)
if (strcmpi(st[inner], st[inner+1])>0)
{
strepy(tamp, st[inner]);
strcpy(st[inner], st[inner+1]);
strepy(st [inner+1], temp);
}
for (i=0; i<n; i++)
printf("\n%s", st[i]);
getch ();
}

20.43. Write a program that read an array of string and display in alphabetic order (with case sensitive).

#include<stdio.h>
#include<conio.h> 
#include<string.h>
void main () 
{
char *st[40] [100],temp[40];
int i,n, outer, inner;
for (i=0; i<100; i++)
st[i]=(char *)malloc(sizeof(char)*100);
clrscr ();
printf("How many word”);
scanf("%d\n", &n);
for (i=0; i<n; i++)
gets (st[i]);
Eor (outer=n-1; outer>=0; outer--)
for (inner=0; inner<outer; inner++)
if (strcmp (st[inner], st[inner+1])>0)
{
strepy (tamp, st[inner]);
strcpy(st[inner], st[inner+1]);
strepy (st [inner+1], temp);
}
for (i=0; i<n; i++)
printf("\n%s", st[i]);
getch ();
}

20.42. Write a program that read and display an array of string.

#include<stdio.h>
#include<conio.h> 
#include<stdlib.h>
#include<string.h>
void main () 
{
void main ()
char *st[100];
int i, n;
st=(char *)malloc(sizeof(char)*100);
clrscr ();
printf("How many line: ");
scanf("%d\n",&n);
for(i=0; i<n; i++)
gets(st[i]);
for(i=0;i<n;i++)
printf("\n%s", st[i]);
getch();
}

20.41. Write a program that read a line of text and display the frequency of every character.

#include<stdio.h>
#include<conio.h> 
#include<stdlib.h>
#include<string.h>
void main () 
{
void main ()
char *st;
int i, l, a[256];
st=(char *)malloc(sizeof(char)*100);
clrscr ();
printf("Enter any line of text: ");
gets (st);
for(i=0; i<256; i++)
a[i]=0;
l=strlen (st);
for(i=0;i<1;i++)
a[*(st+i)++;
for(i=;i<256;i++)
if(a[i]>0)
printf("%c=%2d\t", i, a[i]);
getch();
}

20.40. Write a program that read a line of text and display the frequency of every letter.

#include<stdio.h>
#include<conio.h> 
#include<stdlib.h>
#include<string.h>
void main () 
{
void main ()
char *st;
int i, l, a[26];
st=(char *)malloc(sizeof(char)*100);
clrscr ();
printf("Enter any line of text: ");
gets (st);
l=strlen (st);
for(i=0; i<l; i++)
a[i]=0;
if (*st [i]>='a'&& *st[i]<='z')
a[*(st+i)-97]++;
if (*st [i]>='A'&& *st[i]<='Z')
a[*(st+i)-65]++;
for(i=;i<26;i++)
if(a[i]>0)
printf("\n%c= %d", i+65, a[i]);
getch();
}


20.39. Write a program that read a line of text and display number of vowel, consonant, digit, space and other characters.

#include<stdio.h>
#include<conio.h> 
#include<stdlib.h>
#include<string.h>
void main () 
{
void main ()
char *st;
int i, l, vowel=0, cons=0, digit=0, space=0, other=0;
st=(char *)malloc(sizeof(char)*100);
clrscr ();
printf("Enter any line of text: ");
gets (st);
l=strlen (st);
for(i=0; i<l; i++)
if (*st [i]=='a'||
*st[i]=='e'||*st[i]=='0'||*st[i]=='u’||*st[i]==”A” ||*st[i]=='E’||*st[i]=='I’||*st[i]=='0'||*st [i]=='u')
vowel++;
else if(st[i]>='A'||st[i]<='Z')
cons++;
else if(st[i]>='a'||st [i]<='z')
cons++;
else if(st[i]>='0'||st[i]<='9')
digit++;
else if(st[i]==' ')
space++;
else
other++;
printf("\nVowels %d", vowel);
printf("\nConsonants %d",cons);
printf("\nDigits %d", digit);
printf("\nSpaces %d", space);
printf ("\nOther %d", other);
getch();
}

20.38. Write a program that read a line of text and display number of upper case, lower case, digit, space and other character.

#include<stdio.h>
#include<conio.h> 
#include<stdlib.h>
#include<string.h>
void main ()
{
char *st;
int i,l,upper=0,lower=0,digit=0,space=0,other=0;
st=(char *)malloc(sizeof(char)*100);
printf("Enter any line");
gets(st);
l=strlen(st);
for(i=0;i<1;i++)
if(*(st+i)>="a"&& *(st+i)<="z")
lower++;
else if(*(st+i)>="A" && *(st+i)<="Z")
upper++;
else if(*(st+i)>="0" && *(st+i)<="9")
digit++;
else if(*(st+i)>==" ")
space++;
else
other++;
printf("\nUpper= %d", upper);
printf("\nlower= %d", lower);
printf("\ndigit= %d", digit);
printf("\nspace= %d", space);
printf("\nother= %d", other);
getch ();
}

20.37. Write a program that read any line of text and display every character with ASCII value in separate line.

#include<stdio.h>
#include<conio.h> 
#include<stdlib.h>
#include<string.h>
void main ()
{
char *st;
int i,l;
st=(char *)malloc(sizeof(char)*100);
printf("Enter any line");
gets(st);
l=strlen(st);
for(i=0;i<1;i++)
printf("\n%c %d", st[i], st[i]);
getch ();
}

20.36. Write a program that read any line display every character in separate line.

#include<stdio.h>
#include<conio.h> 
#include<stdlib.h>
#include<string.h>
void main ()
{
char *st;
int i,l;
st=(char *)malloc(sizeof(char)*100);
printf("Enter any line");
gets(st);
l=strlen(st);
for(i=0;i<1;i++)
printf("\n%c", *(st+i));
getch ();
}

20.35. Write a program that read your name and display every character with one space in reverse order.

#include<stdio.h>
#include<conio.h> 
#include<stdlib.h>
#include<string.h>
void main ()
{
char *st;
int i,l;
st=(char *)malloc(sizeof(char)*100);
printf("Enter your name");
gets(st);
l=strlen(st);
for(i=l*1;i>=0;i--)
printf("%c ", *(st+i));
getch ();
}

20.34. Write a program that read your name and display every character with one space.

#include<stdio.h>
#include<conio.h> 
#include<stdlib.h>
#include<string.h>
void main ()
{
char *st;
int i,l;
st=(char *)malloc(sizeof(char)*100);
printf("Enter any line");
gets(st);
l=strlen(st);
for(i=0;i<1;i++)
printf("%c ", *(st+i));
getch ();
}

20.33. Write a program that convert a line to lower case.

#include<stdio.h>
#include<conio.h> 
#include<stdlib.h>
#include<string.h>
void main ()
{
char *st;
int i,l;
st=(char *)malloc(sizeof(char)*100);
printf("Enter any line");
gets(st);
l=strlen(st);
for(i=0;i<1;i++)
if(*(st+i)>="A" && *(st+i)<="Z")
printf("%c",*(st+i)+32);
else
printf("%c", *(st+i));
getch ();
}