-
How to find angle between hands of clock between old time and new time?
input1: 02:45:56 (string)
input2: 03:06:17 (string)
output:
1) angle between the old position of hour hand and new position of hour hand
2) angle between the old position of minute hand and new position of minute hand
3) angle between the old position of second hand and new position of second hand -
Big endian or Little endian
How will you find whether your system is following Big endian or Little endian representations. Write C code. In Little endian, the lowest byte is stored in lowest address.
-
Variables Storage
Variables should be stored in local blocks. Yes or No?
-
Value of x at the Time of Execution
What is the value of x at the time of execution?
int x = 3;
if( x == 2 );
x = 0;
if( x == 3 )
x++;
else x += 2; -
Find Longest Common Substring
Write a Logic/Pseudo Code to find longest common substring from two given strings. i.e. Out of two strings, “I like New York City the most.” And “Who else like New York City as I do?”, “like New York City” is the longest common substring.
Difference between b++ and b=b+1
What is the difference between b++ and b=b+1?
Which one is more used and why?Logical Operator and Pre-increment Operator
what is the output of the following program
int x,y,z;
x=y=z=1;
z=++x||++y &&++z;
printf("%d,%d,%d",x,y,z);
return 0;
Size of structure
struct {
int a : 8;
int b : 10;
int c : 12;
int d : 4;
int e : 3;
int : 0;
int f : 1;
char g;
} A;
what is the size of structure. size of bitfields with out character allocation is 48 bytes. so it is taking 4+4 =8 bytes. what about memory for character. Why memory for char is not allocated seperately. I am...What will be output of following program and how?
i=4;
j=++i*++i;
printf("%d", j);
My Ans-30;How would you declare an array of pointers to functions?
How would you declare an array of pointers to functions that take no parameters and return an int?
A. int (*arr[N])(void);
B. int *arr(void)[N];
C. int *arr[N](void);
D. int (*arr)(void)[N];What is the difference between #include <file> and #include file?
When writing your C program, you can include files in two ways. The first way is to surround the file you want to include with the angled brackets < and >. This method of inclusion tells the preprocessor to look for the file in the predefined default location. This predefined default location is often an INCLUDE environment variable that denotes the path to your include files. For instance,...
What is the stack?
The stack is where all the functions local (auto) variables are created. The stack also contains some information used to call and return from functions. A stack trace is a list of which functions have been called, based on this information. When you start using a debugger, one of the first things you should learn is how to get a stack trace. The stack is very inflexible about allocating memory;...
Is it better to use a pointer to navigate an array of values,or is it better to use a subscripted array name?
Its easier for a C compiler to generate good code for pointers than for subscripts.
What is an argument ? differentiate between formal arguments and actual arguments?
An argument is an entity used to pass the data from calling funtion to the called funtion. Formal arguments are the arguments available in the funtion definition.They are preceded by their own data types.Actual arguments are available in the function call.
Ans