Search:

Type: Posts; User: Parth12

Search: Search took 0.00 seconds.

  1. Replies
    2
    Views
    331

    static variable result

    #include<stdio.h>

    void foo ()
    {
    static int i = 0;
    printf("i = %d \n", i);
    i = 1;
    printf("i = %d \n", i);
    i = 2;
    printf("i = %d \n", i);
  2. Replies
    6
    Views
    453

    given nibble i = 0000 (length 4 bits ) 0001...

    given nibble i = 0000 (length 4 bits )

    0001 // set first bit
    0010 //set only second bit
    0100 //set only third bit
    1000 // set only fourth bit

    How to set single bit at time as shown in...
  3. Replies
    6
    Views
    453

    I did not understand your bit shifting (1

    I did not understand your bit shifting (1 << 4) - 1;

    what result it (1 << 4) gives ?

    What happens if I wan to shift only one bit

    nibble = 0 <<1 = 0
    nibble = 1 <<1 = 1
    nibble = 1 <<0 = 1
  4. Replies
    6
    Views
    453

    How to set all bits in loop

    I want to set all bits in loop

    nibble = 0000; // bits order (4321)


    nibble = nibble|nibble << 1 // set 2nd bit = 0010
    nibble = nibble|nibble << 2 // set 3rd bit = 0100
    nibble =...
  5. Replies
    4
    Views
    368

    I am confuse with following logic operation, ...

    I am confuse with following logic operation, specially with shift operation
    What will the final result of X


    X = 0 | 0 << 0X = 0 | 0
    X = 0


    X = 0 | 1 << 1
    X = 0 |
  6. Replies
    4
    Views
    368

    sorry I have updated previous question because...

    sorry I have updated previous question because R1, R2, R3 create confuse so Now I am just using X, Y and Z

    assume X is status of flag, Y is status of bit and z show the change of Y when flag...
  7. Replies
    4
    Views
    368

    logical operation

    Hello

    logical operation between x and y give z


    X Y Z
    0 0 0
    0 1 1
    1 0 1
    1 1 1
  8. Replies
    11
    Views
    652

    I got it #include int main ()...

    I got it


    #include<stdio.h>

    int main ()
    {
    int number = 987;
    int reminder;
    int reverse = 0;
  9. Replies
    11
    Views
    652

    I tried but I do not understand how to do that

    I tried but I do not understand how to do that
  10. Replies
    11
    Views
    652

    #include int main () { int...

    #include<stdio.h>
    int main ()
    {
    int number = 987;
    int reminder;
    int reverse = 0;

    while ( number > 0 ) {
    reminder = number % 10; // remainder = 987 % 10 -->...
  11. Replies
    11
    Views
    652

    I am using % and / operator ...

    I am using % and / operator


    #include<stdio.h>
    int main ()
    {
    int number = 987;
    int reminder;
    int reverse = 0;
  12. Replies
    11
    Views
    652

    Normally I know How do the Reverse Number. The...

    Normally I know How do the Reverse Number. The problem is that how do I implement the program ?


    #include<stdio.h>

    int main ()
    {
    int number = 987;
    int reminder;
    int reverse = 0;
  13. Replies
    11
    Views
    652

    Reverse number program

    If we know logic how do we write code for it

    For an example

    quotient = 987 / 10 --> 98
    remainder = 987 % 10 --> 7 -> first number
    quotient = 98 / 10 --> 9 --> third number
    remainder =...
  14. Replies
    4
    Views
    468

    something better then previous ...

    something better then previous


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

    struct structure_name
    {
    int i;
    char c;
  15. Replies
    4
    Views
    468

    #include #include struct...

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

    struct structure_name
    {
    int i;
    char c;
    float f;
    struct structure_name * n;
    };
  16. Replies
    4
    Views
    468

    deep confuse with pointer

    Hi,

    I am deeply confuse with pointer after so many reading

    Pointer is variable that hold memory location of variable. variable may be a different type like int, char, float..

    I am confused...
  17. Replies
    1
    Views
    306

    Having difficulty to understand pointers

    Hi,

    I am having difficulty to understand pointers in c language

    I wrote my own code


    #include<stdio.h>

    #include<stdlib.h>
  18. #include int *fun ( int *p ) { ...

    #include<stdio.h>

    int *fun ( int *p )
    {
    *p = 20;

    return p;
    }

    int main ()
  19. I don't have any idea how to do this int * p, ...

    I don't have any idea how to do this

    int * p, pointer type integer
  20. How to verify that function return pointer ...

    How to verify that function return pointer


    #include<stdio.h>

    int * fun ( int *p )
    {
    *p = 20;

    return p;
  21. but both 20 or 0061FF28 are integer I am...

    but both 20 or 0061FF28 are integer

    I am trying to make a function that takes the address of the variable and returns the address.

    First example code how to get return address 0061FF28 from...
  22. #include int fun ( int *p ) { *p...

    #include<stdio.h>
    int fun ( int *p )
    {
    *p = 20;

    return *p;
    }

    int main ()
    {
  23. warning: return makes integer from pointer without a cast

    Hi,

    I have an error warning: return makes integer from pointer without a cast. My code below


    #include<stdio.h>

    int fun ( int *p )
    {
    *p = 20;
Results 1 to 23 of 23