In the following code segment what will be the result of the function, value of x , value of y{unsigned int x=-1;int y;y = ~0;if(x == y)printf("same");elseprintf("not same");}a) same, MAXINT, -1b) not same, MAXINT, -MAXINTc) same , MAXUNIT, -1d) same, MAXUNIT, MAXUNITe) not same, MAXINT, MAXUNIT
Which of the following function is used to repaint a window immediatelya) Sendmessage(hWnd,WM_PAINt,......)b) InvalidateRect(.......)c) MoveWindowd) WM_COPYe) None
The redirection operators > and >>a) do the same functionb) differ : > overwrites, while >> appendsc) differ : > is used for input while >> is used for outputd) differ : > write to any file while >> write only to standard outpute) None of these
C Pure Virtual Function and Virtual Base Class In this C tutorial you will learn about pure virtual function declaration of pure virtual function and virtual base class virtual base class and how to implement a virtual base class explained with examples mosgoogle center What is Pure Virtual Function
C Function Passing Types In this C tutorial you will learn about function passing types two types of arguments passing in functions passed by value and passed by reference are discussed here mosgoogle center The arguments passed to a function can be performed in two ways Passed
DECODE is used to decode a CHAR or VARCHAR2 or NUMBER into any of several different character strings or numbers based on value. That is DECODE does a value-by-value substitution. For every value that is given in the DECODE function it makes an if then check and matches the value. The general format
What is the return value from printf() function?
printf function always returns the number of characters printed. Let us understand this with an example:
main()
{
int a=10;
printf("%d",printf("%d %d %d", a,a,a));
}
In this above program the inner printf i
The declaration of main can be done as
int main()
One more declaration that can be taken by main is command line arguments form
int main(int argc, char *argv[])
or this can also be written as
int main(argc, argv)
int argc;
char *argv[];
NOTE: It is not possible for one to declare the main
Whenever we have more than one function which is called for a finite number of times then such a function gets evaluated from inside out.
Let us understand this concept with an example.
For instance consider a function sample called within it 4 times as given in program below:
main()
{
int a=50;
When a variable is not initialized in main function it contains garbage value. This can be well seen from the example below
main()
{
int x;
printf(“%d”,x);
z= sample()
}
sample()
{
printf(“Testing program”);
}
Output is
&n
The default return value from a function is int. In other words, unless explicitly specified the default return value by compiler would be integer value from function.
When a programmer wants other than integer values to be returned from function then it is essential that the pro
Generally in C program the function definition and calling takes the form as given below:
main()
{
int x,y,z;
z=sample(x,y);
printf(“%d”,z);
}
sample(x1,y1)
int x1,y1;
{
int z1;
z1= x1 - y1;
return(z1);
}
Here what happens is the values x, y gets passed to x1,y1
The arguments passed to function can be of two types
1. Values passed
2. Address passed
The first type refers to call by value and the second type refers to call by reference.
For instance consider program1
main()
{
int x=50, y=70;
interchange(x,y);
printf(“x=%d y=%d”,x,