Best first search program in c?
The best search programs to attempt writing in C are the following: Linear search (simplest), Binary search (faster) Hash search (fastest).
How you can make c program of attendance record system?
how can create a attendece sheet in c language
What is a select case statement used for in programming?
In programming, select case statement is a way to test the inside of a variable. It is used when one knows there is a limited number of things that can be in the variable.
What is the maximum number of different rays that can be formed using the letters a b and c?
What do you mean by 'ray'? If 'string', them here's some possibilities:
'', (1)
'a', 'b', 'c' (3)
'aa', 'ba', 'ca', 'ab', 'bb', 'cb', 'ac', 'bc', 'cc' (9)
'aaa', ... 'ccc' (27)
total: 40
How do you get the output of a three input binary truth table A B C?
by analyzing your three input logic network
What is the reason why you do not see any of the expected output from the DBMS OUTPUT statements.?
You are using the wrong output statements.
What is overloaded subprogram?
subprogram overloading is a process of using the same (function) name for many subprograms. the overloaded subprograms may differ in the number, type or order of its its parameters.java, c++ and c# provides the feature of subprogram overloading .
when an overloaded subprogram is called,java or c++ compiler first checks the subprogram name and then the number and type of parameters are analyzed to decide which version of the overloaded subprogram must be chosen for execution. this process is also known as 'polymorphism'.
the return type of a subprogram has no affect on subprogram overloading whereas it is used to differentiate between the calls in ADA. hence,two overloaded functions in ADA can have the same parameter profile with different return values.
How do you Nibble swap using bitwise operators?
If i is an unsigned char (1 byte unsigned integer) then:
i (i << 4) | (i >> 4);
If you know how to write inline assembly on your compiler (it differs between compilers), then rotating the byte is much more straightforward way to swap nibbles. In Intel assembly, it would look like:
ror i, 4
So in Microsoft compilers it would look like:
__asm
{
ror i,4
}
How do you detect an empty file in a c program?
Seek to the end of the file (fseek) and check how many bytes are in the file
If the byte count is zero the file is empty.
What are the different types of variables?
The exogenous ones, which are set by an outside agent, and the endogenous ones, which occur inside a problem.
So if you look at this formula for a wave in one dimension:
y = exp(-jkx), where k = 2pi / lambda
lambda and x are exogenous while k is endogenous (j and pi are constants).
All members of nested structures must be structure variables?
I don't really get your question, so I give you an example for nested structure:
struct inner1 {
int i;
char c;
};
struct outer {
int i;
char c;
struct inner1 n1;
struct {
int i;
char c;
} n2;
};
valid members for a 'struct outer' type variable are:
.i, .c, .n1.i, .n1.c, .n2.i, .n2.c
The condition requirements (target) of the conditional statement has been met.
What is difference between direct addressing and indirect addressing in c plus plus?
Indirect addressing uses a pointer. Indirectly accessing the memory being pointed at is known as dereferencing. Direct addressing uses a variable's name or a reference to obtain the value.
Which is preferred for writing a Merge Sort routine contiguous or linked memory?
Linked memory because its very useful primarily when the lists to be sorted are very large and the size of data to be moved is small.
Compare break and continue statement?
Break - will force to terminate the loop you are in to the nearest outer block.
Continue - will force to skip the rest of the code in loop and take next iteration.
Break for example is not only limited to loop constructions, it is also used in switch statement in order to stop executing following cases (works as described above, jumps out of switch).
Write a c program that simulates ls command?
#include
#include
#include
#include
int main(int c, char *argv[])
{
DIR *ptr;
int i=0;
struct dirent *p;
ptr = opendir(“.“);
p = readdir(ptr);
if((c!=1) && (strcmp(argv[i]), “-a†0 )
{ //child
execlp ( “/bin/lsâ€, “lsâ€, “-lâ€, NULL ); //execute ls
}
else
{ //parent
wait (NULL); //wait for child
printf(“\nchild complete\nâ€);
exit (0);
}
}
What loop should no execute if the test expression is false to begin with?
for loop and while loop need the expression to be true for further execution of the program.
Difference between current and standard directory in c?
The 'current directory' is where you are in this moment, the 'standard directory' is where something usually is (quite vague definition, isn't it?)... for example, the standard directory for the apache configuration file is /etc/apache, for temporary files it is /tmp