Search:

Type: Posts; User: sana.iitkgp

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    1,325

    Can you post your code here?

    Can you post your code here?
  2. Replies
    36
    Views
    6,715

    My apologies. I was wrong. When i tried to debug...

    My apologies. I was wrong.
    When i tried to debug with gdb, segmentation fault occured in removestring().
  3. Replies
    36
    Views
    6,715

    Your "findString" is not working as expected. It...

    Your "findString" is not working as expected. It is returning a -ve number. Fix that function.
  4. Replies
    16
    Views
    2,156

    You said int is 2 Bytes i.e 16 bits. So you can...

    You said int is 2 Bytes i.e 16 bits. So you can represent 65536 values with int both positive and negative. That range is -32768 to 32767. If any number which is not in that range you cannot...
  5. Replies
    16
    Views
    2,156

    Ok, then int can have values form -32768 to...

    Ok, then int can have values form -32768 to 32767(16 bits signed). Your result is not in this range show it is giving as '0'.
  6. Replies
    16
    Views
    2,156

    Can you explain this? If integer is 32 bit then...

    Can you explain this?
    If integer is 32 bit then expected is "4 -2147483648".
  7. Replies
    33
    Views
    15,711

    INT_MIN is the minimum integer that can be...

    INT_MIN is the minimum integer that can be represented by the int data type.
    It depends on the number of bits for int and whether it is signed/unsigned.
  8. Replies
    33
    Views
    15,711

    For x=-4 and y=5 it is working fine for me.

    For x=-4 and y=5 it is working fine for me.
  9. Replies
    33
    Views
    15,711

    It's working fine

    It's working fine
  10. Replies
    4
    Views
    1,549

    Try this int xy=arr[i].var1;

    Try this


    int xy=arr[i].var1;
  11. Replies
    4
    Views
    2,733

    The main function compiled. It is giving...

    The main function compiled. It is giving segmentation fault because of the last for loop, as it is accesing the memory beyond it allocated.



    # cc -Wall cpb22.c
    cpb22.c: In function āmainā:...
  12. I misunderstood the question. This should...

    I misunderstood the question.

    This should solve your problem.


    #include <ctype.h>
    #include <stdio.h>
    #include <string.h>
    int
    main(void)
  13. Hey, I debugged your code, there are some flaws...

    Hey, I debugged your code, there are some flaws in your code. This code is working fine. You can check the differences.



    #include <ctype.h>
    #include <stdio.h>
    #include <string.h>int...
  14. Replies
    6
    Views
    2,084

    .file "cpb19.c" .section ...

    .file "cpb19.c"
    .section .rodata
    .LC0:
    .string "%d"
    .text
    .globl main
    .type main, @function
    main:
    leal 4(%esp), %ecx
    andl ...
  15. for (a=0;a

    for (a=0;a<(rgn);a++)
    {
    printf("%d ",store[i]);
    i++;
    }


    This is wrong as alredy i is greater than rgn, it won't print the sorted array.
    Sorting is working fine.
  16. Why are you declaring all the arrays as 2-D...

    Why are you declaring all the arrays as 2-D arrays?



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

    int main(void) {

    const int TOTAL_TILES = 98;
  17. One more thing, else ((grade >= 1) &&...

    One more thing,



    else ((grade >= 1) && (grade < 70)); {
    D = D + 1;
    }

    This is wrong, because D=D+1 is getting executed every time as you have ';' at the end of else...
  18. In these printf statements you are printing...

    In these printf statements you are printing address of A not value of A.
    Just remove the '&' before every variable in these printf statements.
    You'll get the actual result.
  19. Replies
    4
    Views
    21,451

    It is giving the correct result. 55+66+77/3=66.

    It is giving the correct result. 55+66+77/3=66.
  20. void getdata(char *, char *, char *); void...

    void getdata(char *, char *, char *);
    void dispdata(char *, char *, char *);


    These two are wrong as your functions take 4 arguments and here you have given only 3.



    void dispdata(char...
  21. Try "scanf("%s",&a);" This will work. a[30]...

    Try "scanf("%s",&a);"
    This will work.

    a[30] is a char, not a string. One more thing you should keep in mind is when you are working with scanf you have to provide the address of variable not the...
  22. Replies
    4
    Views
    1,071

    First you should try. If you find any...

    First you should try. If you find any difficulties, you need to ask here.
  23. Replies
    2
    Views
    1,407

    scanf("%d",&a); This will solve your problem.

    scanf("%d",&a);


    This will solve your problem.
  24. Replies
    18
    Views
    3,490

    Remainder of sum of digits divided by 3 is either...

    Remainder of sum of digits divided by 3 is either '0','1','2'. In the above case it is '1'. So if any of your digits is '1' or '4' or '7' you can directly remove them, otherwise you need to remove...
  25. Replies
    21
    Views
    2,418

    Instead of strcpy() you can just do this...

    Instead of strcpy() you can just do this new->data=string.
    However there is a flaw in your logic. Find that flaw.

    this is the output ::

    # ./a.out
    Enter a string: abcd
    Enter a string: 2erf...
Results 1 to 25 of 42
Page 1 of 2 1 2