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
44 views
asked Jan 7, 2014 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 Jan 7, 2014 by rajesh Guru (39,140 points)

Related questions

0 votes
1 answer 32 views
0 votes
1 answer 27 views
0 votes
1 answer 19 views
0 votes
1 answer 34 views
0 votes
1 answer 25 views
25 views asked Dec 28, 2013 by john Guru (27,140 points)
...