-
Execute C Program
How will you execute a file from another C program through C programming without system command?
-
Link List
What is Link list? What is purpose of link list in programming.
-
Srand() and rand() Functions
Explain srand() and rand() Functions
-
-
-
Carriage Return
Can you tell about C language carriage return. What is the functionality of carriage return in C?
-
Virtual Method
Base class has some virtual method and derived class has a method with the same name. if we initialize the base class pointer with derived object, calling of that virtual method will result in which method being called?
-
Multiply One Set of Numbers
How to multiply one set of numbers with other set of numbers using a for loop?
-
Basic Compilers
What are the types of basic compilers?
-
-
Which expression always return true? Which always return false?
expression if (a=0) always return false expression if (a=1) always return true
-
What is the difference between NULL and NUL?
NULL is a macro defined in <stddef.h> for the null pointer. NUL is the name of the first character in the ASCII character set. It corresponds to a zero value. There’s no standard macro NUL in C, but some people like to define it. The digit 0 corresponds to a value of 80, decimal. Don’t confuse the digit 0 with the value of ‘’ (NUL)! NULL can be defined as ((void*)0), NUL as ‘’.
-
}
">Vii)7. main(){ int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m);}
0 0 1 3 1Explanation :Logical operations always give a result of 1 or 0 . And also the logical AND (&&) operator has higher priority over the logical OR (||) operator. So the expression ‘i++ && j++ && k++’ is executed first. The result of this expression is 0 (-1 && -1 && 0 = 0). Now the expression is 0 || 2 which evaluates to 1 (because OR operator always gives 1 except for ‘0 || 0’ combination-...
-
How do you redirect a standard stream?
Most operating systems, including DOS, provide a means to redirect program input and output to and from different devices. This means that rather than your program output (stdout) going to the screen; it can be redirected to a file or printer port. Similarly, your program’s input (stdin) can come from a file rather than the keyboard. In DOS, this task is accomplished using the redirection characters,...
-
When would you use a pointer to a function?
Pointers to functions are interesting when you pass them to other functions. A function that takes function pointers says, in effect, “Part of what I do can be customized. Give me a pointer to a function, and I’ll call it when that part of the job needs to be done. That function can do its part for me.” This is known as a “callback.” It’s used a lot in graphical user interface libraries, in which...
-
How do you print only part of a string?
/* Use printf() to print the first 11 characters of source_str. */ printf(“First 11 characters: ‘%11.11s’n”, source_str);
-
How can type-insensitive macros be created?
A type-insensitive macro is a macro that performs the same basic operation on different data types. This task can be accomplished by using the concatenation operator to create a call to a type-sensitive function based on the parameter passed to the macro. The following program provides an example: #include <stdio.h> #define SORT(data_type) sort_ ## data_type void sort_int(int** i); void sort_long(long**...
-
-
-
C Interview Questions
Ans