Sunday, July 12, 2009

I want a program in "C" Language that reads 2 names into 2 string parameters then replaces between them

hi all


guess thats easy for some ppl, but not for me....





i just want to create a simple program in "C" language that reads 2 names with scanf function then it puts them into 2 string parameters then it replaces the names in the parameters with each others........








thats all








Notice,,,, the names' length isn't limited !!





thanks alot

I want a program in "C" Language that reads 2 names into 2 string parameters then replaces between them
#include %26lt;stdio.h%26gt;





void main()


{


char[] first, second, temp;


printf("Enter string: ");


scanf(%26amp;first);


printf("\n");


printf("Enter string: ");


scanf(%26amp;second);


printf("\n");


temp = second;


second = first;


first = temp;


}


No comments:

Post a Comment