Can someone verify why my code is bugging out? ( This is in

Can someone verify why my code is bugging out? ( This is in C… Can someone verify why my code is bugging out? (This is in C Programming)The output should accept ‘ox”, Ox” “oX” “OX” optionally, and then convert the hexadecimal to an integer.If I input “OxF” it will say invalid. But if I simply put F, it will give the correct output “15” So if I simply put the hexadecimal value, the output is correct. But if I add oX, or any variation of those two characters, then error output occurs. One other thing to add: When I get the invalid input, it will give the current character position at the end of the string as well. Example “You entered an invalid character! Please enter correct a character 68″ int htoi(char string[]) {//initial variablesint i; int charLoop; int k;       //Set value of variablesk = 0;//checks for ‘0’, ‘o’, ‘O’ and ‘X’, ‘x’if (string[0] == ‘0’ || string[0] == ‘o’ || string[0] == ‘O’ && (string[1] == ‘x’ || string[1] == ‘X’)) {    // if the characters are detected, then the starting position is set to 2.i = 2;}//create loop to check for a hexidecimal letter and convert it to an integer//set I to the value of K  for (i = k; string[i] != ”; i++) { charLoop = string[i];  //if statement to check if the charLoop variable is greater than 0 and less than 9.  if (charLoop >= ‘0’ && charLoop <= '9') {  charLoop = charLoop - '0'; /*If those values aren't met, checks to see if upper case, if not then the program moves on  to check for lowercase.*/ } else if (charLoop >= ‘A’ && charLoop <= 'F') {     // the program will subtract the letter from the value that has been input  charLoop = charLoop - 'A' + 10; } else if (charLoop >= ‘a’ && charLoop <= 'f') {  charLoop = charLoop - 'a' + 10; //if invalid, tells the user to enter a valid input } else {  return printf("You entered an invalid character! Please enter a correct character  "); } k = k * 16 + charLoop;}return k;} #include #include “htoi.h”int main() {//prompt user to input hex stringprintf(“Enter a hex string: “);char hex[20];scanf(“%s”, hex);//call the function and print the resultprintf(“%dn”, htoi(hex));return 0;}  Computer Science Engineering & Technology C++ Programming COMP 215

How it works

  1. Paste your instructions in the instructions box. You can also attach an instructions file
  2. Select the writer category, deadline, education level and review the instructions 
  3. Make a payment for the order to be assignment to a writer
  4.  Download the paper after the writer uploads it 

Will the writer plagiarize my essay?

You will get a plagiarism-free paper and you can get an originality report upon request.

Is this service safe?

All the personal information is confidential and we have 100% safe payment methods. We also guarantee good grades

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Order your essay today and save 20% with the discount code ESSAYHELP