Question

Using the C programming language, please provide a program that takes in a string of Ascii...

Using the C programming language, please provide a program that takes in a string of Ascii characters (using fgets()) and translate it to HEXADECIMAL using bitwise operators only, not arithmetic.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

SOURCE CODE:

*Please follow the comments to better understand the code.

**Please look at the Screenshot below and use this code to copy-paste.

***The code in the below screenshot is neatly indented for better understanding.


#include <stdio.h>
#include <string.h>

int main() {
// read the string
char string[100];
printf("Enter the string: ");
gets(string);
int i=0;
// loop through the string
printf("The Hexadecimal value is: ");
   for(i=0;string[i];i++)
{
printf("%2x ",string[i]);
}
   return 0;
}

=============

Add a comment
Know the answer?
Add Answer to:
Using the C programming language, please provide a program that takes in a string of Ascii...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT