How do I convert this code to C





```
def getDescription (type\_plan ):

    string = ""

    # Check the plan type GENERAL
    if type\_plan[0] == 'A':

        # Check the type of plan
        if type\_plan == "A1":
            string += "Annual Claim Limit 100.000\n"

        # Check the type of plan
        elif type\_plan == "A2":
            string += "Lifetime Claim Limit 500000\n"

        string += "Room Charges 150/day\n"
        string += "Intensive Care Unit (ICU) Charges 300/day\n"
        string += "Hospital Supplies and Services : As charged. Subject to approval by EZMediLife. Surgical Fees\n"

    # Check the plan type GENERAL
    elif type\_plan[0] == 'B':

        # Check the type of plan
        if type\_plan == "B1":
            string += "Annual Claim Limit 200000\n"

        # Check the type of plan
        elif type\_plan == "B2":
            string += "Lifetime Claim Limit 1000000\n"

        string += "Room Charges 200/day\n"
        string += "Intensive Care Unit (ICU) Charges 500/day\n"
        string += "Hospital Supplies and Services : As charged. Subject to approval by EZMediLife. Surgical Fees\n"

    # Check the plan type GENERAL
    elif type\_plan[0] == 'C':

        if type\_plan == "C1":
            string += "Annual Claim Limit 300000\n"
        elif type\_plan == "C2":
            string += "Lifetime Claim Limit 2000000\n"
        string += "Room Charges 300/day\n"
        string += "Intensive Care Unit (ICU) Charges 900/day\n"
        string += "Hospital Supplies and Services : As charged. Subject to approval by EZMediLife. Surgical Fees\n"

    return string
```
  

  

**What I have tried:**  

  

i tried the requirements to write in python. i dont know much about C language.
Something like the following code should do the trick, provided you complete it (just plan 'A' is covered') and make it robust.  

  


```
#include<stdio.h>

int get\_description(const char type\_plan[], const char ** description, const char ** claim\_limit )
{
  int result = 0; // 0 is 'success' , non-zero is 'failure' 

  switch (type\_plan[0])
  {
  case 'A':
    *description = "Room Charges 150/day\nIntensive Care Unit (ICU) Charges 300/day\nHospital Supplies and Services : As charged. Subject to approval by EZMediLife. Surgical Fees\n";
    switch(type\_plan[1])
    {
    case '1':
      *claim\_limit = "Annual Claim Limit 100.000\n";
      break;

    case '2':
      *claim\_limit = "Lifetime Claim Limit 500000\n";
      break;

    default:
      result = -1;
      break;
    }

    break;
  case 'B':
    //...

  case 'C':
    //...

  default:
    result = -1;
    break;
  }

 return result;

}


int main()
{
  const char * plane[]  = { "A1", "K3", "A2" }; -- test planes

  for ( size\_t n=0; n<sizeof(plane) / sizeof(plane[0]); ++n)
  {
    const char * description, * claim\_limit;
    if ( get\_description( plane[n], &description, &claim\_limit) == 0)
    {
      printf("plane %s: %s%s", plane[n], claim\_limit, description);
    }
    else
    {
      printf("unknown plane %s\n", plane[n]);
    }
    printf("\n");
  }
  return 0;
}
```
Statement of work !! Can you try to explain what is that needed from this forum please … 


It’s kind of 


1. Overview  

2. Requirements  

3 Scoping  

4. Architecture design  

5. High level design  

6. Testing /pilot  

7. Solution design guide  

8. Production pilot Your explanation is not consistent. You state that the user is to enter a range as in "find me all numbers between x and y that are divisible by both 3 and 4." Later you state that you "input value 120 10 times". That is inconsistent with the problem so either the problem is stated incorrectly or you are not inputting the expected data. Decide what is the correct problem then write it up in pseudo-code before you write the actual code.


If a range is expected, make sure you test that it is a valid range (x <= y). its kind difficult to understand in my POV but not impossible  

imagining it while reading


can you show some codes? or samples on what you want to achive? i got it over the internet.

var args = array.prototype.slice.call(arguments); How about in c++?



[http://www.1cplusplusstreet.com/vb/scripts/ShowCode.asp?txtCodeId=6877&lngWId=3](/posts/bad_link/258354?url=http%3A%2F%2Fwww.1cplusplusstreet.com%2Fvb%2Fscripts%2FShowCode.asp%3FtxtCodeId%3D6877%26lngWId%3D3) details  here Please post your code so that we can help you. hii..

according to me,the cut off will be around 90-95 marks for general category,50-55 marks for obc category,35-40 marks for sc category and 25-30 marks for st category.so it is difficult to be predict now.

please see the table below for previous years trends:-

 

jee main cut off trends (2013-2017)

| s.no. | category | 2017 | 2016 | 2015 | 2014 | 2013 |
| 1 | general | 81 | 100 | 105 | 115 | 113 |
| 2 | obc-ncl | 49 | 70 | 70 | 74 | 70 |
| 3 | sc | 32 | 52 | 50 | 53 | 50 |
| 4 | st | 27 | 48 | 44 | 47 | 45 | you write an int, but try to receive a c-string, that can not work.

the radio will not be available (i.e. have a packet received) 99.9% of the time,

introducing a delay and printing something if that is the case is just crazy.

so your code seems to be copy and pasted crap without any understandin… Please create an account and send us a private message with the detailed project requirements here -> <https://cpentalk.com/message/cpentalk>  
  
Best regards!