Code for 1>"ascii to string"
2>"string to ascii"



Code for 1>"ascii to string" 2>"string to ascii"..

Answer / riz

#include <iostream>
using namespace std;
int main()
{
char word[32];
int x = 0;
cout << "Please enter the word (maximum 32 characters):\n";
cin >> word;
cout << "The ASCII for this word is:\n";
while (word[x] != '\0') // While the string isn't at the end...
{
cout << int(word[x]); // Transform the char to int
x++;
}
cout << "\n";
return 0;
}

Is This Answer Correct ?    16 Yes 0 No

Post New Answer

More C Code Interview Questions

what is the code of the output of print the 10 fibonacci number series

2 Answers  


main() { int i=10; i=!i>14; Printf ("i=%d",i); }

1 Answers  


main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 b. 2, 100 c. 4, 100 d. 4, 4

18 Answers   HCL, IBM, Infosys, LG Soft, Satyam,


Program to Delete an element from a doubly linked list.

4 Answers   College School Exams Tests, Infosys,


Finding a number which was log of base 2

1 Answers   NetApp,






print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!

35 Answers   Tata Elxsi, TCS, VI eTrans,


Derive expression for converting RGB color parameters to HSV values

1 Answers  


main( ) { char *q; int j; for (j=0; j<3; j++) scanf(“%s” ,(q+j)); for (j=0; j<3; j++) printf(“%c” ,*(q+j)); for (j=0; j<3; j++) printf(“%s” ,(q+j)); }

1 Answers  


void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(“%d”, i); }

2 Answers  


what will be the position of the file marker? a: fseek(ptr,0,SEEK_SET); b: fseek(ptr,0,SEEK_CUR);

2 Answers  


why nlogn is the lower limit of any sort algorithm?

0 Answers  


what is brs test reply me email me kashifabbas514@gmail.com

0 Answers  


Categories