Help our Bob

QUESTION

Bob was bored that day, so she was sitting on the riverbank .Suddenly she notices a talking, White Rabbit with a pocket watch .It ran fast, and she followed it, down a rabbit hole .She fell into the hole and found a magical wonderland with dark trees, beautiful flowers.She found many ways numbered from 1,2,3,……..18.she was confused which is the right way that will lead her to her home. She found a cute bird, standing in one of the tree. Alice asked the bird the way to go back to her home.The bird said a two digit number( say 23 ) and asked her to find the sum of its digits (2+3=5) and that numbered way will lead her to her home.Alice was already confused, so pls help Alice in finding the route to her home….\n\nInput Format:\nInput consists of an integer corresponding to the 2-digit number.\nOutput Format:\nOutput consists of an integer corresponding to the sum of its digits. Refer sample input and output for formatting specifications.\n\n[All text in bold corresponds to input and the rest corresponds to output]\n.

“TESTCASE_1”: “23\n###—###SEPERATOR—###—\nBob must go in path-5 to find her way to home”, “TESTCASE_2”: “99\n###—###SEPERATOR—###—\nBob must go in path-18 to find her way to home”, “TESTCASE_3”: “25\n###—###SEPERATOR—###—\nBob must go in path-7 to find her way to home”, “TESTCASE_4”: “0\n###—###SEPERATOR—###—\n0”, “TESTCASE_5”: “0\n###—###SEPERATOR—###—\n0

ANSWER

#include<stdio.h>
int main(){
  int b,a,c;
  scanf("%d",&b);
  a=b%10;
  c=b/10;
  printf("Bob must go in path-%d to find her way to home",a+c);
  return 0;
}
Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
CHP Adblock Detector Plugin | Codehelppro