Search:

Type: Posts; User: leo2008

Page 1 of 9 1 2 3 4

Search: Search took 0.01 seconds; generated 18 minute(s) ago.

  1. Thread: smallest coin

    by leo2008
    Replies
    2
    Views
    2,476

    I am trying to solve this in c programming, maybe...

    I am trying to solve this in c programming, maybe the logic that I provided is not working as expected.
  2. Replies
    2
    Views
    2,270

    Below are the comments added inline here. What...

    Below are the comments added inline here.

    What is "k-drome"? A string is k-drome if it can be transformed into a palindrome, by removing at the most N characters from it.

    What do you mean...
  3. Thread: smallest coin

    by leo2008
    Replies
    2
    Views
    2,476

    smallest coin

    I am trying to find the amount here.
    Input

    The first line of input contains an integer M, the number of coins in bank.
    The second line of input contains M integers: coin1, coin2... coinN. coini...
  4. Replies
    2
    Views
    2,270

    string manipulate

    I am trying to resolve the below string manipulation.
    But code doesn't work as expected. Need help with some inputs.

    Input

    First line of input contains string M, consisting of lowercase...
  5. Replies
    4
    Views
    2,508

    How can I prevent return a pointer in this case?

    How can I prevent return a pointer in this case?
  6. Replies
    4
    Views
    2,508

    return double issue

    I have the below code which has issue with double return value. How can I fix it?



    double *funct( double i )
    {
    double result = 2.0 * i;
    return &result;
    }
  7. Replies
    6
    Views
    3,527

    do you mean to say that we should not use sort...

    do you mean to say that we should not use sort algo in this case? If so, how can we solve this? The issue here is that there is a list which is sorted already, except for one item which is in wrong...
  8. Replies
    6
    Views
    3,527

    do you mean to say that we should not use sort...

    do you mean to say that we should not use sort algo in this case? If so, how can we solve this?
  9. Replies
    6
    Views
    3,527

    When one item in the list is in wrong place,...

    When one item in the list is in wrong place, should I use Merge sort or Bubble sort considering the time complexity of sort algo?
  10. Replies
    6
    Views
    3,527

    data structure usage

    I have some basic doubts with data structure usage.
    Please confirm if my below understanding is correct.?

    Link List can be used to frequently need to add and remove elements from the middle of a...
  11. Replies
    25
    Views
    18,183

    Hi rstanley Did you write any new function to...

    Hi rstanley

    Did you write any new function to handle negative values?
    If I provide positive numbers there are no issues seen, with the existing logic.

    Enter a number and base
    12 2
    String :...
  12. Replies
    25
    Views
    18,183

    I identified problem was due to 2 files with the...

    I identified problem was due to 2 files with the same name, after renaming it, i was able to resolve compile issues.
    Tested and it shows below output. if I provide negative number it gives strange...
  13. Replies
    25
    Views
    18,183

    If I test below code, it throws errors. I am not...

    If I test below code, it throws errors. I am not sure why these errors are coming here?
    Where are these multiple definitions for itoa, main and reverse?




    #include <stdio.h>
    #include...
  14. Replies
    25
    Views
    18,183

    I have modified the below code and tested output...

    I have modified the below code and tested output below. But it doesnt print any string values after providing number and base. Can someone help me understand what is wrong in this code?


    ...
  15. Replies
    25
    Views
    18,183

    If I remove stdbool.h, I get the below errors. ...

    If I remove stdbool.h, I get the below errors.




    main.c:28:1: error: unknown type name ‘bool’
    28 | bool isnegative = false;
    | ^~~~
    main.c:37:1: error: unknown type name ‘bool’
    ...
  16. Replies
    25
    Views
    18,183

    I have removed the const input and below is my...

    I have removed the const input and below is my code. please check it.



    #include <stdio.h>
    #include <stdbool.h>
    #define true 1
    #define false 0
  17. Replies
    25
    Views
    18,183

    How to change code logic to handle negative to...

    How to change code logic to handle negative to positive? I mean change -726 to +726. In your itoa function, something like this?



    if((signal = n)<0)//record signal
    n=-n;//make n a positive...
  18. Replies
    25
    Views
    18,183

    As per your logic, it output as -726. How can I...

    As per your logic, it output as -726. How can I used void function to implement itoa? I need to use below signature.



    void itoa (const int input, char* output) {}
  19. Replies
    25
    Views
    18,183

    can anyone help me? i am stuck with this code.

    can anyone help me? i am stuck with this code.
  20. Replies
    25
    Views
    18,183

    Modified code as below, but has compile errors.....

    Modified code as below, but has compile errors.. what is wrong here?



    #include <stdio.h>
    #include <stdbool.h>
    #define true 1
    #define false 0
  21. Replies
    25
    Views
    18,183

    I changed code logic as below, but getting...

    I changed code logic as below, but getting compile errors. what is wrong here?




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

    void itoa (const int input, char* output, int...
  22. Replies
    25
    Views
    18,183

    Below is the reverse function logic. void...

    Below is the reverse function logic.



    void reverse(char output[])
    {
    int i, j;
    char c;

    for (i = 0, j = strlen(output)-1; i<j; i++, j--) {
  23. Replies
    25
    Views
    18,183

    urgent help needed with itoa

    Hi

    I need help with implementing itoa function as below. What is wrong with my below code? It has compilation errors.



    #include <stdio.h>
    #include <math.h>
    #include <string.h>
  24. Replies
    7
    Views
    6,297

    This is not MCQ, I suspected those could be the...

    This is not MCQ, I suspected those could be the reasons. My strong suspect is that static member function doesn't need to be called from an instance of their own class . i am not a design pattern...
  25. Replies
    7
    Views
    6,297

    Did you mean to say that is it because static...

    Did you mean to say that is it because static inheritance allows objects to be instantiated or static member data can be shared across all instances or static member function doesn't need to be...
Results 1 to 25 of 222
Page 1 of 9 1 2 3 4