C Books Guide and List
C++ Books Guide and List
Best Java Books

3,749 questions

4,049 answers

114 comments

10,705 users

Write a C program to interchange the elements of a character array using pointer?

0 votes
54 views
asked by smith Geek (15,340 points)

1 Answer

0 votes

#include<stdio.h>

#include<conio.h>

void main()

{

char *names[]={“anand”,“murugan”,“selvaraj”, “annammal”,”shrikarthick”, “renukadevi”};

char*tmp;

clrscr();

printf(“original: %s%s”, names[3], names[4]);

tmp=names[3];

names[3]=names[4];

names[4]=temp;

printf(“\n New : %s%s”,names[3],names[4]);

getch();

}

Output:

Original : annammal shrikarthick

New :shrikarthick annammal 

answered by rajesh Guru (39,140 points)

Related questions

0 votes
1 answer 29 views
0 votes
1 answer 21 views
0 votes
1 answer 28 views
...