Search:

Type: Posts; User: aakashjohari

Search: Search took 0.01 seconds.

  1. Replies
    13
    Views
    6,318

    Please can you tell me the answer for the...

    Please can you tell me the answer for the following test case?

    5 9 1 2
    6 8 1 2
    7 6 1 2
    8 4 1 2
  2. Replies
    1
    Views
    720

    Memory to be deallocated

    Hi All,
    I have written the following code.



    #include <stdio.h>
    #include <stdlib.h>

    int main()
    {
  3. Yes, you are right cas. It is machine dependent.

    Yes, you are right cas. It is machine dependent.
  4. Yes, You all are right. I have experimented...

    Yes, You all are right.

    I have experimented this.

    C maintains a stack for arguments.


    printf ("%c %c", 'A', 'B');

    In this case, 'A' is first pop-out and then 'B'. (A character is 8-bit...
  5. It is not the case that the program is not...

    It is not the case that the program is not compiled correctly.

    printf() is returning 11.

    and I have compiled it with -lm switch. So no chance of not being compiled correctly.

    Hoping for the...
  6. I know well. That I must you %d instead of %f for...

    I know well. That I must you %d instead of %f for this. But the question is that why it is affecting the second correctly specified ceil() function value
  7. Problem With ceil() and floor() functions

    Hi all,
    Please go through the following very basic code.



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

    int main()
    {
  8. Replies
    2
    Views
    3,412

    I think this may help you out. This gives the the...

    I think this may help you out. This gives the the approximate time (more than the observed running time by "time" command in linux).



    #include <stdio.h>
    #include <time.h>

    int main()
    {
    ...
  9. Replies
    3
    Views
    1,418

    Convert the user's answer string into lower case....

    Convert the user's answer string into lower case. And have your capital list also in lower case(as you have already had in capital array). Now you easily can compare both strings by strcmp() function.
  10. Replies
    21
    Views
    2,513

    I can answer you for your second question. In...

    I can answer you for your second question.

    In C, any non-zero integer is considered as true and zero as false. So In the following for loop suppose e has initial value as 5. Then as 5 is non-zero...
  11. Replies
    6
    Views
    1,049

    This may help you out. #include ...

    This may help you out.



    #include <stdlib.h>
    #include <stdio.h>

    void func(int **data)
    {
    *data = (int *)malloc(2 * sizeof(int));
  12. Replies
    9
    Views
    1,720

    But please go through this link. It says that...

    But please go through this link.

    It says that memory allocation goes contiguous even for the statically defined variables.

    How Stuff Works

    Thanks and Best Regards,
    Aakash Johari
  13. Replies
    2
    Views
    840

    It is very easy to add it for thousand times....

    It is very easy to add it for thousand times. Your current code is perfect for a single interation. What you will have to do is just to enclose it within a loop that runs for 1000 times.

    You must...
  14. Replies
    9
    Views
    1,720

    Memory Allocation in Stack

    Hello All,
    I have written the following code. I have declared 2 arrays t and s both of size of 4 integers and two integer variables u and i. Please pay attention to the order they...
  15. Replies
    10
    Views
    1,226

    Sorry, I couldnt get you. :(

    Sorry, I couldnt get you. :(
  16. Replies
    10
    Views
    1,226

    Thank you very much. I got it. :)

    Thank you very much.

    I got it. :)
  17. Replies
    10
    Views
    1,226

    In which way, it becomes invalid. Its still...

    In which way, it becomes invalid. Its still pointing to the same address. And after running the whole code, I found the output:


    0 20 30

    Means, it just cleared out the first integer space and...
  18. Replies
    10
    Views
    1,226

    Problem with pointers

    Hello,
    I was doing some experiments with pointer and wrote the following code :-


    #include <stdio.h>
    #include <stdlib.h>

    int main()
    {
    int *p;
Results 1 to 18 of 18