-
Swapping of two numbers
How to swap two numbers without using temporary variable?
-
Even or Odd number
Write a program to find a number if even or odd with out using conditional operator and if-else?
-
What is static memory allocation and dynamic memory allocation?
Static memory allocation: The compiler allocates the required memory space for a declared variable.By using the address of operator,the reserved address is obtained and this address may be assigned to a pointer variable.Since most of the declared variable have static memory,this way of assigning pointer value to a pointer variable is known as static memory allocation. memory is assigned during...
-
printf("%s", obj->pName);
}
">Struct Foo{ char *pName;};main(){ struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); strcpy(obj->pName,"Your Name"); printf("%s", obj->pName);}
A) NameB) compile errorC) Your NameD) Runtime error
-
-
-
-
-
-
-
-
What is the difference between declaring a variable and defining a variable?
Declaring a variable means describing its type to the compiler but not allocating any space for it. Defining a variable means declaring it and also allocating space to hold the variable. You can also initialize a variable at the time it is defined.
-
-
-
-
}
">#define SQR(x) x * xmain(){ printf("%d", 225/SQR(15));}
A) 15B) 225C) 1D) none of the above
-
-
-
-
C Interview Questions
Ans