Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


simple c++ program for "abcde123ba" convert "ab321edcba"
with out using string

Answers were Sorted based on User's Feedback



simple c++ program for "abcde123ba" convert "ab321edcba" with out using string..

Answer / prasenjit roy

#include "stdio.h"

int main(int argc, char* argv[])
{
char sBuffer[]="abcde123ba";
char sBuff[100];
char *pStr = sBuffer;
int i;
puts(sBuffer);

while(*pStr != '\0')
++pStr;
for ( i = 0; pStr != sBuffer; i++,pStr--)
sBuff[i] = pStr[-1];
sBuff[i] = '\0';

puts(sBuff);
return 0;
}

Is This Answer Correct ?    5 Yes 1 No

simple c++ program for "abcde123ba" convert "ab321edcba" with out using string..

Answer / pramod

void mystrrev(char* str)
{
char ch;
int last=strlen(str)-1;
for(int i=0;i<last;i++,last--)
{
ch=str[i];
str[i]=str[last];
str[last]=ch;
}
}

Is This Answer Correct ?    5 Yes 1 No

simple c++ program for "abcde123ba" convert "ab321edcba" with out using string..

Answer / ragavan

#include<stdio.h>
#include<conio.h>
//Using recursive
void print( char c)
{
char a;
if(c=='\n')
return;
a=getchar();
print(a);
printf("%c",c);
return;
}

void main()
{
char c;
clrscr();
c= getchar();
print(c);
getch();
}

Is This Answer Correct ?    3 Yes 0 No

simple c++ program for "abcde123ba" convert "ab321edcba" with out using string..

Answer / abdelrhman matter

#include<iostream>
using namespace std;
int main ()
{
cout<<" insert Any number and i will switch it : ";
int num; cin>>num;
do
{
cout<<num%10;
num = num/10;
}while(num>0);

cout<<endl;
return 0;
}

Is This Answer Correct ?    1 Yes 1 No

simple c++ program for "abcde123ba" convert "ab321edcba" with out using string..

Answer / sandeep

#include<iostream.h>
#include<string.h>
int main()
{

char a='abcde123ba';
strrev(a);
cout<<a;
getch();
return 0;
}

Is This Answer Correct ?    2 Yes 11 No

Post New Answer

More C++ General Interview Questions

What is an overflow error?

0 Answers  


Ask to write virtual base class code?

0 Answers   Satyam,


What is a "Copy Constructor"?

2 Answers  


Explain how a pointer to function can be declared in C++?

0 Answers  


What are the extraction and insertion operators in c++? Explain with examples.

0 Answers  


What are c++ data types?

0 Answers  


given unsigned int ui1=3,ui2=7; what are the outputs of a)ui1 & ui2 b)ui1 && ui2 c)ui1 | ui2 d)ui1 || ui2 i also need the justification for the answers thank you

2 Answers  


Define a program that reads two matrices of size 3x3 with real values from the user then prints their sum, difference and multiplication.

0 Answers   TCS,


why and when we can declar member fuction as a private in the class?

0 Answers  


What are the five basic elements of a c++ program?

0 Answers  


Please explain class & object in c++?

0 Answers  


What is size of a empty class?

7 Answers   Microsoft, Tata Elxsi, Wipro,


Categories