#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);
Type: Posts; User: Parth12
#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);
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...
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
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 =...
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 |
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...
Hello
logical operation between x and y give z
X Y Z
0 0 0
0 1 1
1 0 1
1 1 1
I got it
#include<stdio.h>
int main ()
{
int number = 987;
int reminder;
int reverse = 0;
I tried but I do not understand how to do that
#include<stdio.h>
int main ()
{
int number = 987;
int reminder;
int reverse = 0;
while ( number > 0 ) {
reminder = number % 10; // remainder = 987 % 10 -->...
I am using % and / operator
#include<stdio.h>
int main ()
{
int number = 987;
int reminder;
int reverse = 0;
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;
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 =...
something better then previous
#include<stdio.h>
#include<stdlib.h>
struct structure_name
{
int i;
char c;
#include<stdio.h>
#include<stdlib.h>
struct structure_name
{
int i;
char c;
float f;
struct structure_name * n;
};
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...
Hi,
I am having difficulty to understand pointers in c language
I wrote my own code
#include<stdio.h>
#include<stdlib.h>
#include<stdio.h>
int *fun ( int *p )
{
*p = 20;
return p;
}
int main ()
I don't have any idea how to do this
int * p, pointer type integer
How to verify that function return pointer
#include<stdio.h>
int * fun ( int *p )
{
*p = 20;
return p;
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...
#include<stdio.h>
int fun ( int *p )
{
*p = 20;
return *p;
}
int main ()
{
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;