Questions et réponses d'entretien les plus demandées et tests en ligne
Plateforme d'apprentissage pour la preparation aux entretiens, les tests en ligne, les tutoriels et la pratique en direct

Developpez vos competences grace a des parcours cibles, des tests blancs et un contenu pret pour l'entretien.

WithoutBook rassemble des questions d'entretien par sujet, des tests pratiques en ligne, des tutoriels et des guides de comparaison dans un espace d'apprentissage reactif.

Preparation a l'entretien

Tests blancs

Definir comme page d'accueil

Ajouter cette page aux favoris

S'abonner avec une adresse e-mail
Entretiens blancs LIVE WithoutBook
Le meilleur entretien blanc en direct a voir avant un entretien
Test your skills through the online practice test: Language in C Quiz Online Practice Test

Questions et reponses niveau debutant / jeunes diplomes

Question 1. What will be the output of the following code?

void main ()
{ int i = 0 , a[3] ;
a[i] = i++;
printf ("%d",a[i]) ;
}

The output for the above code would be a garbage value. In the statement a[i] = i++; the value of the variable i would get assigned first to a[i] i.e. a[0] and then the value of i would get incremented by 1. Since a[i] i.e. a[1] has not been initialized, a[i] will have a garbage value.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 2. Why doesn't the following code give the desired result?

int x = 3000, y = 2000 ;
long int z = x * y ;

Here the multiplication is carried out between two ints x and y, and the result that would overflow would be truncated before being assigned to the variable z of type long int. However, to get the correct output, we should use an explicit cast to force long arithmetic as shown below:

long int z = ( long int ) x * y ;
Note that ( long int )( x * y ) would not give the desired effect.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 3. Why doesn't the following statement work?

char str[ ] = "Hello" ;
strcat ( str, '!' ) ;

The string function strcat( ) concatenates strings and not a character. The basic difference between a string and a character is that a string is a collection of characters, represented by an array of characters whereas a character is a single character. To make the above statement work writes the statement as shown below:
strcat ( str, "!" ) ;

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 4. How do I know how many elements an array can hold?

The amount of memory an array can consume depends on the data type of an array. In DOS environment, the amount of memory an array can consume depends on the current memory model (i.e. Tiny, Small, Large, Huge, etc.). In general an array cannot consume more than 64 kb. Consider following program, which shows the maximum number of elements an array of type int, float and char can have in case of Small memory model.
main( )
{
int i[32767] ;
float f[16383] ;
char s[65535] ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 5. How do I write code that reads data at memory location specified by segment and offset?

Use peekb( ) function. This function returns byte(s) read from specific segment and offset locations in memory. The following program illustrates use of this function. In this program from VDU memory we have read characters and its attributes of the first row. The information stored in file is then further read and displayed using peek( ) function.

#include <stdio.h>
#include <dos.h>

main( )
{

char far *scr = 0xB8000000 ;
FILE *fp ;
int offset ;
char ch ;

if ( ( fp = fopen ( "scr.dat", "wb" ) ) == NULL )
{

printf ( "nUnable to open file" ) ;
exit( ) ;

}

// reads and writes to file
for ( offset = 0 ; offset < 160 ; offset++ )
fprintf ( fp, "%c", peekb ( scr, offset ) ) ;
fclose ( fp ) ;

if ( ( fp = fopen ( "scr.dat", "rb" ) ) == NULL )
{

printf ( "nUnable to open file" ) ;
exit( ) ;

}

// reads and writes to file
for ( offset = 0 ; offset < 160 ; offset++ )
{

fscanf ( fp, "%c", &ch ) ;
printf ( "%c", ch ) ;

}

fclose ( fp ) ;

}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 6. How do I compare character data stored at two different memory locations?

Sometimes in a program we require to compare memory ranges containing strings. In such a situation we can use functions like memcmp( ) or memicmp( ). The basic difference between two functions is that memcmp( ) does a case-sensitive comparison whereas memicmp( ) ignores case of characters. Following program illustrates the use of both the functions.

#include <mem.h>

main( )
{
char *arr1 = "Kicit" ;
char *arr2 = "kicitNagpur" ;

int c ;

c = memcmp ( arr1, arr2, sizeof ( arr1 ) ) ;

if ( c == 0 )
printf ( "nStrings arr1 and arr2 compared using memcmp are identical" ) ;

else
printf ( "nStrings arr1 and arr2 compared using memcmp are not identical"
) ;

c = memicmp ( arr1, arr2, sizeof ( arr1 ) ) ;

if ( c == 0 )
printf ( "nStrings arr1 and arr2 compared using memicmp are identical" )
;
else
printf ( "nStrings arr1 and arr2 compared using memicmp are not
identical" ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 7. The Spawnl( ) function...

DOS is a single tasking operating system, thus only one program runs at a time. The Spawnl( ) function provides us with the capability of starting the execution of one program from within another program. The first program is called the parent process and the second program that gets called from within the first program is called a child process. Once the second program starts execution, the first is put on hold until the second program completes execution. The first program is then restarted. The following program demonstrates use of spawnl( ) function.

/* Mult.c */

int main ( int argc, char* argv[ ] )
{
int a[3], i, ret ;
if ( argc < 3 || argc > 3 )
{
printf ( "Too many or Too few arguments..." ) ;
exit ( 0 ) ;
}

for ( i = 1 ; i < argc ; i++ )
a[i] = atoi ( argv[i] ) ;
ret = a[1] * a[2] ;
return ret ;
}

/* Spawn.c */
#include <process.h>
#include <stdio.h>

main( )
{
int val ;
val = spawnl ( P_WAIT, "C:\Mult.exe", "3", "10",
"20", NULL ) ;
printf ( "nReturned value is: %d", val ) ;
}

Here, there are two programs. The program 'Mult.exe' works as a child process whereas 'Spawn.exe' works as a parent process. On execution of 'Spawn.exe' it invokes 'Mult.exe' and passes the command-line arguments to it. 'Mult.exe' in turn on execution, calculates the product of 10 and 20 and returns the value to val in 'Spawn.exe'. In our call to spawnl( ) function, we have passed 6 parameters, P_WAIT as the mode of execution, path of '.exe' file to run as child process, total number of arguments to be passed to the child process, list of command line arguments and NULL. P_WAIT will cause our application to freeze execution until the child process has completed its execution. This parameter needs to be passed as the default parameter if you are working under DOS. under other operating systems that support multitasking, this parameter can be P_NOWAIT or P_OVERLAY. P_NOWAIT will cause the parent process to execute along with the child process, P_OVERLAY will load the child process on top of the parent process in the memory.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 8. Are the following two statements identical?

char str[6] = "Kicit" ;
char *str = "Kicit" ;

No! Arrays are not pointers. An array is a single, pre-allocated chunk of contiguous elements (all of the same type), fixed in size and location. A pointer on the other hand, is a reference to any data element (of a particular type) located anywhere. A pointer must be assigned to point to space allocated elsewhere, but it can be reassigned any time. The array declaration char str[6] ; requests that space for 6 characters be set aside, to be known
by name str. In other words there is a location named str at which six characters are stored. The pointer declaration char *str ; on the other hand, requests a place that holds a pointer, to be known by the name str. This pointer can point almost anywhere to any char, to any contiguous array of chars, or nowhere.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 9. Is the following code fragment correct?

const int x = 10 ;
int arr[x] ;

No! Here, the variable x is first declared as an int so memory is reserved for it. Then it is qualified by a const qualifier. Hence, const qualified object is not a constant fully. It is an object with read only attribute, and in C, an object associated with memory cannot be used in array dimensions.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 10. How do I write code to retrieve current date and time from the system and display it as a string?

Use time( ) function to get current date and time and then ctime( ) function to display it as a string. This is shown in following code snippet.

#include <systypes.h>

void main( )
{
time_t curtime ;
char ctm[50] ;

time ( &curtime ) ; //retrieves current time &
stores in curtime
printf ( "nCurrent Date & Time: %s", ctime (
&curtime ) ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 11. How do I change the type of cursor and hide a cursor?

We can change the cursor type by using function _setcursortype( ). This function can change the cursor type to solid cursor and can even hide a cursor. Following code shows how to change the cursor type and hide cursor.

#include <conio.h>
main( )
{
/* Hide cursor */
_setcursortype ( _NOCURSOR ) ;

/* Change cursor to a solid cursor */
_setcursortype ( _SOLIDCURSOR ) ;

/* Change back to the normal cursor */
_setcursortype ( _NORMALCURSOR ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 12. How do I write code that would get error number and display error message if any standard error occurs?

Following code demonstrates this.

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>

main( )
{
char *errmsg ;
FILE *fp ;
fp = fopen ( "C:file.txt", "r" ) ;
if ( fp == NULL )
{
errmsg = strerror ( errno ) ;
printf ( "n%s", errmsg ) ;
}
}
Here, we are trying to open 'file.txt' file. However, if the file does not exist, then it would cause an error. As a result, a value (in this case 2) related to the error generated would get set in errno. errno is an external int variable declared in 'stdlib.h' and also in 'errno.h'. Next, we have called sterror( ) function which takes an error number and returns a pointer to standard error message related to the given error number.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 13. How do I write code to get the current drive as well as set the current drive?

The function getdisk( ) returns the drive number of current drive. The drive number 0 indicates 'A' as the current drive, 1 as 'B' and so on. The Setdisk( ) function sets the current drive. This function takes one argument which is an integer indicating the drive to be set. Following program demonstrates use of both the functions.

#include <dir.h>

main( )
{
int dno, maxdr ;

dno = getdisk( ) ;
printf ( "nThe current drive is: %cn", 65 + dno
) ;

maxdr = setdisk ( 3 ) ;
dno = getdisk( ) ;
printf ( "nNow the current drive is: %cn", 65 +
dno ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 14. The functions memcmp( ) and memicmp( )

The functions memcmp( ) and memicmp( ) compares first n bytes of given two blocks of memory or strings. However, memcmp( ) performs comparison as unsigned chars whereas memicmp( ) performs comparison as chars but ignores case (i.e. upper or lower case). Both the functions return an integer value where 0 indicates that two memory buffers compared are identical. If the value returned is greater than 0 then it indicates that the first buffer is bigger than the second one. The value less than 0 indicate that the first buffer is less than the second buffer. The following code snippet demonstrates use of both

#include <stdio.h>
#include <mem.h>

main( )
{
char str1[] = "This string contains some
characters" ;
char str2[] = "this string contains" ;
int result ;

result = memcmp ( str1, str2, strlen ( str2 ) ) ;
printf ( "nResult after comapring buffer using
memcmp( )" ) ;
show ( result ) ;

result = memicmp ( str1, str2, strlen ( str2 ) ) ;
printf ( "nResult after comapring buffer using
memicmp( )" ) ;
show ( result ) ;
}

show ( int r )
{
if ( r == 0 )
printf ( "nThe buffer str1 and str2 hold
identical data" ) ;
if ( r > 0 )
printf ( "nThe buffer str1 is bigger than buffer
str2" ) ;
if ( r < 0 )
printf ( "nThe buffer str1 is less than buffer
str2" ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 15. How do I write code to find an amount of free disk space available on current drive?

Use getdfree( ) function as shown in follow code.

#include <stdio.h>
#include <stdlib.h>
#include <dir.h>
#include <dos.h>

main( )
{
int dr ; struct dfree disk ;
long freesp ;

dr = getdisk( ) ;
getdfree ( dr + 1 , &disk ) ;

if ( disk.df_sclus == 0xFFFF )
{
printf ( "ngetdfree( ) function failedn");
exit ( 1 ) ;
}

freesp = ( long ) disk.df_avail
* ( long ) disk.df_bsec
* ( long ) disk.df_sclus ;
printf ( "nThe current drive %c: has %ld bytes
available as free spacen", 'A' + dr, freesp ) ;
}

17.

Use of array indices...
If we wish to store a character in a char variable ch and the character to be stored depends on the value of another variable say color (of type int), then the code would be as shown below:

switch ( color )
{
case 0 :
ch = 'R' ;
break ;
case 1 :
ch = 'G' ;
break ;
case 2 :
ch = 'B' ;
break ;
}
In place of switch-case we can make use of the value in color as an index for a character array. How to do this is shown in following code snippet.

char *str = "RGB' ;
char ch ;
int color ;
// code
ch = str[ color ] ;

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 16. How do I write a user-defined function, which deletes each character in a string str1, which matches any character in string str2?

The function is as shown below:

Compress ( char str1[], char str2[] )
{
int i, j, k ;

for ( i = k = 0 ; str1[i] != ???? ; i++ )
{
for ( j = 0 ; str2[j] != ???? && str2[j] !=
str1[i] ; j++ )
;
if ( str2[j] == ???? )
str1[k++] = str1[I] ;
}
str1[k] = ????
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 17. How does free( ) know how many bytes to free?

The malloc( ) / free( ) implementation remembers the size of each block allocated and returned, so it is not necessary to remind it of the size when freeing.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 18. What is the use of randomize( ) and srand( ) function?

While generating random numbers in a program, sometimes we require to control the series of numbers that random number generator creates. The process of assigning the random number generators starting number is called seeding the generator. The randomize( ) and srand( ) functions are used to seed the random number generators. The randomize( ) function uses PC's clock to produce a random seed, whereas the srand( ) function allows us to specify the random number generator's starting value.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 19. How do I determine amount of memory currently available for allocating?

We can use function coreleft( ) to get the amount of memory available for allocation. However, this function does not give an exact amount of unused memory. If, we are using a small memory model, coreleft( ) returns the amount of unused memory between the top of the heap and stack. If we are using a larger model, this function returns the amount of memory between the highest allocated memory and the end of conventional memory. The function returns amount of memory in terms of bytes.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 20. How does a C program come to know about command line arguments?

When we execute our C program, operating system loads the program into memory. In case of DOS, it first loads 256 bytes into memory, called program segment prefix. This contains file table, environment segment, and command line information. When we compile the C program the compiler inserts additional code that parses the command, assigning it to the argv array, making the arguments easily accessible within our C program.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 21. When we open a file, how does functions like fread( )/fwrite( ), etc. get to know from where to read or to write the data?

When we open a file for read/write operation using function like fopen( ), it returns a pointer to the structure of type FILE. This structure stores the file pointer called position pointer, which keeps track of current location within the file. On opening file for read/write operation, the file pointer is set to the start of the file. Each time we read/write a character, the position pointer advances one character. If we read one line of text at a step from the file, then file pointer advances to the start of the next line. If the file is opened in append mode, the file pointer is placed at the very end of the file. Using fseek( ) function we can set the file pointer to some other place within the file.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 22. The sizeof( ) function doesn??t return the size of the block of memory pointed to by a pointer. Why?

The sizeof( ) operator does not know that malloc( ) has been used to allocate a pointer. sizeof( ) gives us the size of pointer itself. There is no handy way to find out the size of a block allocated by malloc( ).

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 23. Compare FP_SEG And FP_OFF.

Sometimes while working with far pointers we need to break a far address into its segment and offset. In such situations we can use FP_SEG and FP_OFF macros. Following program illustrates the use of these two macros.
#include

main( )
{
unsigned s, o ;
char far *ptr = "Hello!" ;

s = FP_SEG ( ptr ) ;
o = FP_OFF ( ptr ) ;
printf ( "n%u %u", s, o ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 24. How do I write a program to convert a string containing number in a hexadecimal form to its equivalent decimal?

The following program demonstrates this:
main( )
{
char str[] = "0AB" ;
int h, hex, i, n ;
n = 0 ; h = 1 ;
for ( i = 0 ; h == 1 ; i++ )
{
if ( str[i] >= '0' && str[i] <= '9' )
hex = str[i] - '0' ;
else
{
if ( str[i] >= 'a' && str[i] <= 'f' )
hex = str[i] - 'a' + 10 ;
else
if ( str[i] >= 'A' && str[i] <= 'F' )
hex = str[i] - 'A' + 10 ;
else
h = 0 ;
}
if ( h == 1 )
n = 16 * n + hex ;
}
printf ( "nThe decimal equivalent of %s is %d",
str, n ) ;
}
The output of this program would be the decimal equivalent of 0AB is 171.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 25. How do I write code that reads the segment register settings?

We can use segread( ) function to read segment register settings. There are four segment registers??code segment, data segment, stack segment and extra segment. Sometimes when we use DOS and BIOS services in a program we need to know the segment register's value. In such a situation we can use segread( ) function. The following program illustrates the use of this function.
#include <dos.h>
main( )
{
struct SREGS s ;
segread ( &s ) ;
printf ( "nCS: %X DS: %X SS: %X ES: %X",s.cs,
s.ds, s.ss, s.es ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 26. What is environment and how do I get environment for a specific entry?

While working in DOS, it stores information in a memory region called environment. In this region we can place configuration settings such as command path, system prompt, etc. Sometimes in a program we need to access the information contained in environment. The function getenv( ) can be used when we want to access environment for a specific entry. Following program demonstrates the use of this function.
#include <stdio.h>
#include <stdlib.h>

main( )
{
char *path = NULL ;

path = getenv ( "PATH" ) ;
if ( *path != NULL )
printf ( "nPath: %s", path ) ;
else
printf ( "nPath is not set" ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 27. How do I display current date in the format given below?
Saturday October 12, 2002

Following program illustrates how we can display date in above given format.

#include
#include

main( )
{
struct tm *curtime ;
time_t dtime ;

char str[30] ;

time ( &dtime ) ;
curtime = localtime ( &dtime ) ;
strftime ( str, 30, "%A %B %d, %Y", curtime ) ;

printf ( "n%s", str ) ;
}
Here we have called time( ) function which returns current time. This time is returned in terms of seconds, elapsed since 00:00:00 GMT, January 1, 1970. To extract the week day, day of month, etc. from this value we need to break down the value to a tm structure. This is done by the function localtime( ). Then we have called strftime( ) function to format the time and store it in a string str.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 28. If we have declared an array as global in one file and we are using it in another file then why doesn't the sizeof operator works on an extern array?

An extern array is of incomplete type as it does not contain the size. Hence we cannot use sizeof operator, as it cannot get the size of the array declared in another file. To resolve this use any of one the following two solutions:
1. In the same file declare one more variable that holds the size of array. For example,

array.c

int arr[5] ;
int arrsz = sizeof ( arr ) ;

myprog.c

extern int arr[] ;
extern int arrsz ;
2. Define a macro which can be used in an array
declaration. For example,

myheader.h

#define SZ 5

array.c

#include "myheader.h"
int arr[SZ] ;

myprog.c

#include "myheader.h"
extern int arr[SZ] ;

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 29. How do I write printf( ) so that the width of a field can be specified at runtime?

This is shown in following code snippet.

main( )
{
int w, no ;
printf ( "Enter number and the width for the
number field:" ) ;
scanf ( "%d%d", &no, &w ) ;
printf ( "%*d", w, no ) ;
}
Here, an '*' in the format specifier in printf( ) indicates that an int value from the argument list should be used for the field width.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 30. How to find the row and column dimension of a given 2-D array?

Whenever we initialize a 2-D array at the same place where it has been declared, it is not necessary to mention the row dimension of an array. The row and column dimensions of such an array can be determined programmatically as shown in following program.

void main( )
{
int a[][3] = { 0, 1, 2,
9,-6, 8,
7, 5, 44,
23, 11,15 } ;

int c = sizeof ( a[0] ) / sizeof ( int ) ;
int r = ( sizeof ( a ) / sizeof ( int ) ) / c ;
int i, j ;

printf ( "nRow: %dnCol: %dn", r, c ) ;
for ( i = 0 ; i < r ; i++ )
{
for ( j = 0 ; j < c ; j++ )
printf ( "%d ", a[i][j] ) ;
printf ( "n" ) ;
}
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 31. The access( ) function...

The access( ) function checks for the existence of a file and also determines whether it can be read, written to or executed. This function takes two arguments the filename and an integer indicating the access mode. The values 6, 4, 2, and 1 checks for read/write, read, write and execute permission of a given file, whereas value 0 checks whether the file exists or not. Following program demonstrates how we can use access( ) function to check if a given file exists.

#include <io.h>

main( )
{
char fname[67] ;

printf ( "nEnter name of file to open" ) ;
gets ( fname ) ;

if ( access ( fname, 0 ) != 0 )
{
printf ( "nFile does not exist." ) ;
return ;
}
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 32. How do I convert a floating-point number to a string?

Use function gcvt( ) to convert a floating-point number to a string. Following program demonstrates the use of this function.
#include <stdlib.h>

main( )
{
char str[25] ;
float no ;
int dg = 5 ; /* significant digits */

no = 14.3216 ;
gcvt ( no, dg, str ) ;
printf ( "String: %sn", str ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 33. What is a stack ?

The stack is a region of memory within which our programs temporarily store data as they execute. For example, when a program passes parameters to functions, C places the parameters on the stack. When the function completes, C removes the items from the stack. Similarly, when a function declares local variables, C stores the variable's values on the stack during the function's execution. Depending on the program's use of functions and parameters, the amount of stack space that a program requires will differ.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 34. Allocating memory for a 3-D array

#include "alloc.h"
#define MAXX 3
#define MAXY 4
#define MAXZ 5
main( )
{
int ***p, i, j, k ;
p = ( int *** ) malloc ( MAXX * sizeof ( int ** ) ) ;
for ( i = 0 ; i < MAXX ; i++ )
{
p[i] = ( int ** ) malloc ( MAXY * sizeof ( int * ) ) ;
for ( j = 0 ; j < MAXY ; j++ )
p[i][j] = ( int * ) malloc ( MAXZ * sizeof ( int ) ) ;
}
for ( k = 0 ; k < MAXZ ; k++ )
{
for ( i = 0 ; i < MAXX ; i++ )
{
for ( j = 0 ; j < MAXY ; j++ )
{
p[i][j][k] = i + j + k ;
printf ( "%d ", p[i][j][k] ) ;
}
printf ( "n" ) ;
}
printf ( "nn" ) ;
}
}
Data Structures
How to distinguish between a binary tree and a tree?

A node in a tree can have any number of branches. While a binary tree is a tree structure in which any node can have at most two branches. For binary trees we distinguish between the subtree on the left and subtree on the right, whereas for trees the order of the subtrees is irrelevant.
Consider the following figure...

This above figure shows two binary trees, but these binary trees are different. The first has an empty right subtree while the second has an empty left subtree. If the above are regarded as trees (not the binary trees), then they are same despite the fact that they are drawn differently. Also, an empty binary tree can exist, but there is no tree having zero nodes.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 35. How do I use the function ldexp( ) in a program?

The math function ldexp( ) is used while solving the complex mathematical equations. This function takes two arguments, a double value and an int respectively. The order in which ldexp( ) function performs calculations is ( n * pow ( 2, exp ) ) where n is the double value and exp is the integer. The following program demonstrates the use of this function.

#include <stdio.h>
#include <math.h>

void main( )
{
double ans ;
double n = 4 ;

ans = ldexp ( n, 2 ) ;
printf ( "nThe ldexp value is : %lfn", ans ) ;
}
Here, ldexp( ) function would get expanded as ( 4 * 2 * 2 ), and the output would be the ldexp value is : 16.000000

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 36. Can we get the mantissa and exponent form of a given number?

The function frexp( ) splits the given number into a mantissa and exponent form. The function takes two arguments, the number to be converted as a double value and an int to store the exponent form. The function returns the mantissa part as a double value. Following example demonstrates the use of this function.

#include <math.h>
#include <stdio.h>

void main( )
{
double mantissa, number ;
int exponent ;

number = 8.0 ;
mantissa = frexp ( number, &exponent ) ;

printf ( "The number %lf is ", number ) ;
printf ( "%lf times two to the ", mantissa ) ;
printf ( "power of %dn", exponent ) ;

return 0 ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 37. How do I write code that executes certain function only at program termination?

Use atexit( ) function as shown in following program.

#include <stdlib.h>
main( )
{
int ch ;
void fun ( void ) ;
atexit ( fun ) ;
// code
}
void fun( void )
{
printf ( "nTerminate program......" ) ;
getch( ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 38. What are memory models?

The compiler uses a memory model to determine how much memory is allocated to the program. The PC divides memory into blocks called segments of size 64 KB. Usually, program uses one segment for code and a second segment for data. A memory model defines the number of segments the compiler can use for each. It is important to know which memory model can be used for a program. If we use wrong memory model, the program might not have enough memory to execute. The problem can be solved using larger memory model. However, larger the memory model, slower is your program execution. So we must choose the smallest memory model that satisfies our program needs. Most of the compilers support memory models like tiny, small, medium, compact, large and huge.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 39. How does C compiler store elements in a multi-dimensional array?

The compiler maps multi-dimensional arrays in two ways??Row major order and Column order. When the compiler places elements in columns of an array first then it is called column-major order. When the compiler places elements in rows of an array first then it is called row-major order. C compilers store multidimensional arrays in row-major order. For example, if there is a multi-dimensional array a[2][3], then according row-major order, the elements would get stored in memory following order:
a[0][0], a[0][1], a[0][2], a[1][0], a[1][1], a[1][2]

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 40. If the result of an _expression has to be stored to one of two variables, depending on a condition, can we use conditional operators as shown below?

( ( i < 10 ) ? j : k ) = l * 2 + p ;

No! The above statement is invalid. We cannot use the conditional operators in this fashion. The conditional operators like most operators, yields a value, and we cannot assign the value of an _expression to a value. However, we can use conditional operators as shown in following code snippet.

main( )
{
int i, j, k, l ;
i = 5 ; j = 10 ; k = 12, l = 1 ;
* ( ( i < 10 ) ? &j : &k ) = l * 2 + 14 ;
printf ( "i = %d j = %d k = %d l = %d", i, j, k, l ) ;
}

The output of the above program would be as given below:
i = 5 j = 16 k = 12 l = 1

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 41. How can I find the day of the week of a given date?

The following code snippet shows how to get the day of week from the given date.

dayofweek ( int yy, int mm, int dd )
{
/*Monday = 1 and Sunday = 0 */
/* month number >= 1 and <= 12, yy > 1752 or so */
static int arr[ ] = { 0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4 } ;
yy = yy - mm < 3 ;
return ( yy + yy / 4 - yy / 100 + yy / 400 + arr[ mm - 1] + dd ) % 7 ;
}

void main( )
{
printf ( "nnnDay of week : %d ", dayofweek ( 2002, 5, 18 ) ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 42. What's the difference between these two declarations?

struct str1 { ... } ;
typedef struct { ... } str2 ;

The first form declares a structure tag whereas the second declares a typedef. The main difference is that the second declaration is of a slightly more abstract type -- its users don't necessarily know that it is a structure, and the keyword struct is not used when declaring instances of it.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 43. How do I print the contents of environment variables?

. The following program shows how to achieve this:
main( int argc, char *argv[ ], char *env[ ] )
{
int i = 0 ;
clrscr( ) ;
while ( env[ i ] )
printf ( "n%s", env[ i++ ] ) ;
}

main( ) has the third command line argument env, which is an array of pointers to the strings. Each pointer points to an environment variable from the list of environment variables.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 44. What would the second and the third printf( ) output the following program?

main( )
{
char *str[ ] = {
"Good Morning"
"Good Evening"
"Good Afternoon"
} ;
printf ( "nFirst string = %s", str[0] ) ;
printf ( "nSecond string = %s", str[1] ) ;
printf ( "nThird string = %s", str[2] ) ;
}

For the above given program, we expect the output as Good Evening and Good Afternoon, for the second and third printf( ). However, the output would be as shown below.

First string = Good MorningGood EveningGood Afternoon
Second string = ( null )
Third string =

What is missing in the above given code snippet is a comma separator which should separate the strings Good Morning, Good Evening and Good Afternoon. On adding comma, we would get the output as shown below.

First string = Good Morning
Second string = Good Evening
Third string = Good Afternoon

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 45. How do I use scanf( ) to read the date in the form 'dd-mm-yy' ?

There are two ways to read the date in the form of 'dd-mm-yy' one possible way is...

int dd, mm, yy ;
char ch ; /* for char '-' */
printf ( "nEnter the date in the form of dd-mm-yy : " ) ;
scanf( "%d%c%d%c%d", &dd, &ch, &mm, &ch, &yy ) ;

And another best way is to use suppression character * as...

int dd, mm, yy ;
scanf( "%d%*c%d%*c%d", &dd, &mm, &yy ) ;

The suppression character * suppresses the input read from the standard input buffer for the assigned control character.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 46. How do I print a floating-point number with higher precision say 23.34568734 with only precision up to two decimal places?

This can be achieved through the use of suppression char '*' in the format string of printf( ) as shown in the following program.
main( )
{
int i = 2 ;
float f = 23.34568734 ;
printf ( "%.*f", i, f ) ;
}
The output of the above program would be 23.35.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 47. Are the expressions *ptr++ and ++*ptr same?

No. *ptr++ increments the pointer and not the value pointed by it, whereas ++*ptr increments the value being pointed to by ptr.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 48. strpbrk( )

The function strpbrk( ) takes two strings as parameters. It scans the first string, to find, the first occurrence of any character appearing in the second string. The function returns a pointer to the first occurrence of the character it found in the first string. The following program demonstrates the use of string function strpbrk( ).

#include <string.h>
main( )
{
char *str1 = "Hello!" ;
char *str2 = "Better" ;
char *p ;
p = strpbrk ( str1, str2 ) ;

if ( p )
printf ( "The first character found in str1 is %c", *p ) ;
else
printf ( "The character not found" ) ;
}
The output of the above program would be the first character found in str1 is e


div( )...

The function div( ) divides two integers and returns the quotient and remainder. This function takes two integer values as arguments; divides first integer with the second one and returns the answer of division of type div_t. The data type div_t is a structure that contains two long ints, namely quot and rem, which store quotient and remainder of division respectively. The following example shows the use of div( ) function.

#include <stdlib.h>
void main( )
{
div_t res ;

res = div ( 32, 5 ) ;
printf ( "nThe quotient = %d and remainder = %d ", res.quot, res.rem ) ;

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 49. Can we convert an unsigned long integer value to a string?

The function ultoa( ) can be used to convert an unsigned long integer value to a string. This function takes three arguments, first the value that is to be converted, second the base address of the buffer in which the converted number has to be stored (with a string terminating null character '') and the last argument specifies the base to be used in converting the value. Following example demonstrates the use of this function.

#include <stdlib.h>
void main( )
{
unsigned long ul = 3234567231L ;
char str[25] ;

ultoa ( ul, str, 10 ) ;
printf ( "str = %s unsigned long = %lun", str, ul ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 50. ceil( ) and floor( )

The math function ceil( ) takes a double value as an argument. This function finds the smallest possible integer to which the given number can be rounded up. Similarly, floor( ) being a math function, takes a double value as an argument and returns the largest possible integer to which the given double value can be rounded down. The following program demonstrates the use of both the functions.

#include <math.h>
void main( )
{
double no = 1437.23167 ;
double down, up ;

down = floor ( no ) ;
up = ceil ( no ) ;

printf ( "The original number %7.5lfn", no ) ;
printf ( "The number rounded down %7.5lfn", down ) ;
printf ( "The number rounded up %7.5lfn", up ) ;
}

The output of this program would be,
The original number 1437.23167
The number rounded down 1437.00000
The number rounded up 1438.00000

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 51. How do I use function ecvt( ) in a program?

The function ecvt( ) converts a floating-point value to a null terminated string. This function takes four arguments, such as, the value to be converted to string, the number of digits to be converted to string, and two integer pointers. The two-integer pointer stores the position of the decimal point (relative to the string) and the sign of the number, respectively. If the value in a variable, used to store sign is 0, then the number is positive and, if it is non-zero, then the number is negative. The function returns a pointer to the string containing digits. Following program demonstrates the use of this function.

#include <stdlib.h>
main( )
{
char *str ;
double val ;
int dec, sign ;
int ndig = 4 ;

val = 22 ;
str = ecvt ( val, ndig, &dec, &sign ) ;
printf ( "string = %s dec = %d sign = %dn", str, dec, sign ) ;

val = -345.67 ;
ndig = 8 ;
str = ecvt ( val, ndig, &dec, &sign ) ;
printf ( "string = %s dec = %d sign = %dn", str, dec, sign ) ;

// number with a scientific notation
val = 3.546712e5 ;
ndig = 5 ;
str = ecvt ( val, ndig, &dec, &sign ) ;
printf ( "string = %s dec = %d sign = %dn", str, dec, sign ) ;
}

The output of this program would be

string = 2200 dec = 2 sign = 0
string = 34567000 dec = 3 sign = 1
string = 35467 dec = 6 sign = 0

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 52. How to run DIR command programmatically?

We can use the system( ) function to execute the DIR command along with its options. Following program shows how this can be achieved:

// mydir.c

main ( int argc, char *argv[ ] )
{
char str[30] ;

if ( argc < 2 )
exit ( 0 ) ;

sprintf ( str, "dir %s %s", argv[1], argv[2] ) ;
system ( str ) ;
}

If we run the executable file of this program at command prompt passing the command line arguments as follows:

> mydir abc.c /s

This will search the file 'abc.c' in the current directory.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 53. Suppose I have a structure having fields name, age, salary and have passed address of age to a function fun( ). How I can access the other member of the structure using the address of age?

struct emp
{
char name[20] ;
int age ;
float salary ;
} ;
main( )
{
struct emp e ;
printf ( "nEnter name: " ) ;
scanf ( "%s", e.name ) ;
printf ( "nEnter age: " ) ;
scanf ( "%d", &e.age ) ;
printf ( "nEnter salary: " ) ;
scanf ( "%f", &e.salary ) ;
fun ( &e.age ) ;
}
fun ( int *p )
{
struct emp *q ;
int offset ;
offset = ( char * ) ( & ( ( struct emp * ) 0 ) -> age ) - ( char * ) ( (
struct emp* ) 0 ) ;
q = ( struct emp * ) ( ( char * ) p - offset ) ;
printf ( "nname: %s", q -> name ) ;
printf ( "nage: %d", q -> age ) ;
printf ( "nsalary: %f", q -> salary ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 54. How to restrict the program's output to a specific screen region?

A C function window( ) can be used to restrict the screen output to a specific region. The window( ) function defines a text-mode window. The parameters passed to this function defines the upper-left and lower-right corner of the region within which you want the output. In the following program, the string 'Hello!' gets printed within the specified region. To print the string we must use cprintf( ) function which prints directly on the text-mode window.

#include <conio.h>
main( )
{
int i, j ;

window ( 20, 8, 60, 17 ) ;
for ( i = 0 ; i < 8 ; i++ )
for ( j = 0 ; j < 10 ; j++ )
cprintf ( "Hello!" ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 55. Sometimes you need to prompt the user for a password. When the user types in the password, the characters the user enters should not appear on the screen. A standard library function getpass( ) can be used to perform such function. Maximum number of characters that can be entered as password is 8.

main( )
{
char *pwd ;

pwd = getpass ( "Enter Password" ) ;

if ( strcmp ( pwd, "orgcity" ) )
printf ( "nPassword %s is incorrect", pwd ) ;
else
printf ( "nCorrect Password" ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 56. How to obtain the current drive through C ?

We can use the function _getdrive( ) to obtain the current drive. The _getdrive( ) function uses DOS function 0X19 to get the current drive number

#include <direct.h>
main( )
{
int disk ;
disk = _getdrive( ) + 'A' - 1 ;
printf ( "The current drive is: %cn", disk ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 57. How come the output for both the programs is different when the logic is same?

main( )
{
int i, j ;

for ( i = 1, j = 1 ; i <= 5, j <= 100 ; i++, j++ )
{
gotoxy ( 1, 1, ) ;
printf ( "%d %d", i, j ) ;
}
}

main( )
{
int i, j ;

for ( i =1, j = 1; j <= 100, i <= 5; i++, j++ )
{
gotoxy ( 1, 1 ) ;
printf ( "%d %d", i, j ) ;
}
}

Output -> 5 5

Even if logic of both the programs is same the output of the first program comes out to be 100, 100, but of the second program it is 5, 5. The comma operator plays a vital role inside the for loop. It always considers the value of the latest variable. So, at the time of testing the condition in for loop, the value of j will be considered in the first program and value of i in the second.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 58. Can we get the x and y coordinate of the current cursor position ?

The function wherex( ) and wherey( ) returns the x-coordinate and y-coordinate of the current cursor position respectively. Both the functions return an integer value. The value returned by wherex( ) is the horizontal position of cursor and the value returned by wherey( ) is the vertical position of the cursor. Following program shows how to use the wherex( ) and wherey( ) functions.

#include <conio.h>
main( )
{
printf ( "Justn Ton Testn Wheren the cursorn goes" ) ;

printf ( "Current location is X: %d Y: %dn", wherex( ), wherey( ) ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 59. How do I programmatically delete lines in the text window?

While writing programs that perform screen-based I/O, you may want to-delete the current line's contents, moving one line up, all of the output that follows. In such cases a function called delline( ) can be used. Following code snippet illustrates the use of function delline( ).

#include <conio.h>
main( )
{
int i ;
clrscr( ) ;

for ( i = 0; i <= 23; i++ )
printf ( "Line %drn", i ) ;

printf ( "Press a key to continue : " ) ;
getch( ) ;

gotoxy ( 2, 6 ) ;

for ( i = 6; i <= 12; i++ )
delline( ) ;

getch( ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 60. How do I get the time elapsed between two function calls ?

The function difftime( ) finds the difference between two times. It calculates the elapsed time in seconds and returns the difference between two times as a double value.

#include <time.h>
#include <stdio.h>
#include <dos.h>

main( )
{
int a[] = { 2, -34, 56, 78, 112, 33, -7, 11, 45, 29, 6 } ;
int s ;
time_t t1, t2 ; // time_t defines the value used for time function

s = sizeof ( a ) / 2 ;
t1 = time ( NULL ) ;
sel_sort ( a, s ) ; // sort array by selection sort
bub_sort ( a, s ) ; // sort array by bubble sort method
t2 = time ( NULL ) ;
printf ( "nThe difference between two function calls is %f", difftime (
t2, t1 ) ) ;
}

In the above program we have called difftime( ) function that returns the time elapsed from t1 to t2.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 61. How do I use swab( ) in my program ?

The function swab( ) swaps the adjacent bytes of memory. It copies the bytes from source string to the target string, provided that the number of characters in the source string is even. While copying, it swaps the bytes which are then assigned to the target string.

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

main ( )
{
char *str1 = "hS eesll snsiasl not eh es as oher " ;
char *str2 ;
clrscr( ) ;
swab ( str1, str2, strlen ( str1 ) ) ;
printf ( "The target string is : %sn", str2 ) ; // output -- She sells
snails on the sea shore
getch( ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 62. What does the error "Null Pointer Assignment" mean and what causes this error?

The Null Pointer Assignment error is generated only in small and medium memory models. This error occurs in programs which attempt to change the bottom of the data segment. In Borland's C or C++ compilers, Borland places four zero bytes at the bottom of the data segment, followed by the Borland copyright notice "Borland C++ - Copyright 1991 Borland Intl.". In the small and medium memory models, a null pointer points to DS:0000. Thus assigning a value to the memory referenced by this pointer will overwrite the first zero byte in the data segment. At program termination, the four zeros and the copyright banner are checked. If either has been modified, then the Null Pointer Assignment error is generated. Note that the pointer may not truly be null, but may be a wild pointer that references these key areas in the data segment.

Data Structures

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 63. How to build an expression trees ?

An expression tree is a binary tree which is built from simple operands and operators of an (arithmetic or logical ) expression by placing simple operands as the leaves of a binary tree and the operators as the interior nodes. If an operator is binary , then it has two nonempty subtrees, that are its left and right operands (either simple operands or sub expressions). If an operator is unary, then only one of its subtrees is nonempty, the one on the left or right according as the operator is written on the right or left of its operand. We traditionally write some unary operators to the left of their operands, such as "-" ( unary negation) or the standard functions like log( ), sin( ) etc. Others are written on the right, such as the factorial function ()!. If the operator is written on the left, then in the expression tree we take its left subtree as empty. If it appears on the right, then its right subtree will be empty. An example of an expression tree is shown below for the expression ( -a < b ) or ( c + d ) .

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 64. Can we get the remainder of a floating point division ?

Yes. Although the % operator fails to work on float numbers we can still get the remainder of floating point division by using a function fmod( ). The fmod( ) function divides the two float numbers passed to it as parameters and returns the remainder as a floating-point value. Following program shows fmod( ) function at work.

#include <math.h>

main( )
{
printf ( "%f", fmod ( 5.15, 3.0 ) ) ;
}

The above code snippet would give the output as 2.150000.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 65. How to extract the integer part and a fractional part of a floating point number?

C function modf( ) can be used to get the integer and fractional part of a floating point.

#include "math.h"

main( )
{
double val, i, f ;
val = 5.15 ;
f = modf ( val, &i ) ;
printf ( "nFor the value %f integer part = %f and fractional part = %f",
val, i, f ) ;
}

The output of the above program will be:

For the value 5.150000 integer part = 5.000000 and fractional part =
0.150000

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 66. How do I define a pointer to a function which returns a char pointer?

char * ( *p )( ) ;
or
typedef char * ( * ptrtofun )( ) ;
ptrtofun p ;
Here is a sample program which uses this definition.
main( )
{
typedef char * ( * ptrtofun ) ( ) ;
char * fun( ) ;
ptrtofun fptr ;
char *cptr ;
fptr = fun ;
cptr = (*fptr) ( ) ;
printf ( "nReturned string is "%s"", cptr ) ;
}
char * fun( )
{
static char s[ ] = "Hello!" ;
printf ( "n%s", s ) ;
return s ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 67. What's wrong with the following declaration: char* ptr1, ptr2 ; get errors when I try to use ptr2 as a pointer.

char * applies only to ptr1 and not to ptr2. Hence ptr1 is getting declared as a char pointer, whereas, ptr2 is being declared merely as a char. This can be rectified in two ways :
char *ptr1, *ptr2 ;
typedef char* CHARPTR ; CHARPTR ptr1, ptr2 ;

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 68. How to use scanf( ) to read the date in the form of dd-mm-yy?

To read the date in the form of dd-mm-yy one possible way is,
int dd, mm, yy ;
char ch ; /* for char '-' */
printf ( "nEnter the date in the form of dd-mm-yy : " ) ;
scanf( "%d%c%d%c%d", &dd, &ch, &mm, &ch, &yy ) ;
Another way is to use suppression character * is as follows:
int dd, mm, yy ;
scanf( "%d%*c%d%*c%d", &dd, &mm, &yy ) ;
The suppression character '*' suppresses the input read from the standard input buffer for the assigned control character.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 69. Why the output of sizeof ( 'a' ) is 2 and not 1 ?

Character constants in C are of type int, hence sizeof ( 'a' ) is equivalent to sizeof ( int ), i.e. 2. Hence the output comes out to be 2 bytes.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 70. Can we use scanf( ) function to scan a multiple words string through keyboard?

Yes. Although we usually use scanf( ) function to receive a single word string and gets( ) to receive a multi-word string from keyboard we can also use scanf( ) function for scanning a multi-word string from keyboard. Following program shows how to achieve this.

main( )
{
char buff[15] ;
scanf ( "%[^n]s", buff ) ;
puts ( buff ) ;
}

In the scanf( ) function we can specify the delimiter in brackets after the ^ character. We have specified 'n' as the delimiter. Hence scanf( ) terminates only when the user hits Enter key.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 71. How to set the system date through a C program ?

We can set the system date using the setdate( ) function as shown in the following program. The function assigns the current time to a
structure date.

#include "stdio.h"
#include "dos.h"

main( )
{
struct date new_date ;

new_date.da_mon = 10 ;
new_date.da_day = 14 ;
new_date.da_year = 1993 ;

setdate ( &new_date ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 72. How can I write a general-purpose swap without using templates?

Given below is the program which uses the stringizing preprocessor directive ## for building a general purpose swap macro which can swap two integers, two floats, two chars, etc.
#define swap( a, b, t ) ( g ## t = ( a ), ( a ) = ( b ), ( b ) = g ## t )
int gint;
char gchar;
float gfloat ;
main( )
{
int a = 10, b = 20 ;
char ch1 = 'a' , ch2 = 'b' ;
float f1 = 1.12, f2 = 3.14 ;
swap ( a, b, int ) ;
printf ( "na = %d b = %d", a, b ) ;
swap ( ch1, ch2, char ) ;
printf ( "nch1 = %c ch2 = %c", ch1, ch2 ) ;
swap ( f1, f2, float ) ;
printf ( "nf1 = %4.2f f2 = %4.2f", f1, f2 ) ;
}
swap ( a, b, int ) would expand to,
( gint = ( a ), ( a ) = ( b ), ( b ) = gint )

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 73. What is a heap ?

Heap is a chunk of memory. When in a program memory is allocated dynamically, the C run-time library gets the memory from a collection of unused memory called the heap. The heap resides in a program's data segment. Therefore, the amount of heap space available to the program is fixed, and can vary from one program to another.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 74. How to obtain a path of the given file?

The function searchpath( ) searches for the specified file in the subdirectories of the current path. Following program shows how to make use of the searchpath( ) function.

#include "dir.h"

void main ( int argc, char *argv[] )
{
char *path ;
if ( path = searchpath ( argv[ 1 ] ) )
printf ( "Pathname : %sn", path ) ;
else
printf ( "File not foundn" ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 75. Can we get the process identification number of the current program?

Yes! The macro getpid( ) gives us the process identification number of the program currently running. The process id. uniquely identifies a program. Under DOS, the getpid( ) returns the Program Segment Prefix as the process id. Following program illustrates the use of this macro.
#include <stdio.h>
#include <process.h>

void main( )
{
printf ( "The process identification number of this program is %Xn",
getpid( ) ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 76. How do I write a function that takes variable number of arguments?

The following program demonstrates this.

#include <stdio.h>
#include <stdarg.h>

void main( )
{
int i = 10 ;
float f = 2.5 ;
char *str = "Hello!" ;
vfpf ( "%d %f %sn", i, f, str ) ;
vfpf ( "%s %s", str, "Hi!" ) ;
}

void vfpf ( char *fmt, ... )
{
va_list argptr ;
va_start ( argptr, fmt ) ;
vfprintf ( stdout, fmt, argptr ) ;
va_end ( argptr ) ;
}

Here, the function vfpf( ) has called vfprintf( ) that take variable argument lists. va_list is an array that holds information required for the macros va_start and va_end. The macros va_start and va_end provide a portable way to access the variable argument lists. va_start would set up a pointer argptr to point to the first of the variable arguments being passed to the function. The macro va_end helps the called function to perform a normal return.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 77. Can we change the system date to some other date?

Yes, We can! The function stime( ) sets the system date to the specified date. It also sets the system time. The time and date is measured in seconds from the 00:00:00 GMT, January 1, 1970. The following program shows how to use this function.
#include <stdio.h>
#include <time.h>

void main( )
{
time_t tm ;
int d ;

tm = time ( NULL ) ;

printf ( "The System Date : %s", ctime ( &tm ) ) ;
printf ( "nHow many days ahead you want to set the date : " ) ;
scanf ( "%d", &d ) ;

tm += ( 24L * d ) * 60L * 60L ;

stime ( &tm ) ;
printf ( "nNow the new date is : %s", ctime ( &tm ) ) ;
}
In this program we have used function ctime( ) in addition to function stime( ). The ctime( ) function converts time value to a 26-character long string that contains date and time.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 78. How to use function strdup( ) in a program?

The string function strdup( ) copies the given string to a new location. The function uses malloc( ) function to allocate space required for the duplicated string. It takes one argument a pointer to the string to be duplicated. The total number of characters present in the given string plus one bytes get allocated for the new string. As this function uses malloc( ) to allocate memory, it is the programmer??s responsibility to deallocate the memory using free( ).
#include <stdio.h>
#include <string.h>
#include <alloc.h>

void main( )
{
char *str1, *str2 = "double";

str1 = strdup ( str2 ) ;
printf ( "%sn", str1 ) ;
free ( str1 ) ;
}

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 79. On including a file twice I get errors reporting redefinition of function.
How can I avoid duplicate inclusion?

Redefinition errors can be avoided by using the following macro definition. Include this definition in the header file.
#if !defined filename_h
#define filename_h
/* function definitions */
#endif
Replace filename_h with the actual header file name. For example, if name of file to be included is 'goto.h' then replace filename_h with 'goto_h'.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 80. How to write a swap( ) function which swaps the values of the variables using bitwise operators.

Here is the swap( ) function.
swap ( int *x, int *y )
{
*x ^= *y ;
*y ^= *x ;
*x ^= *y ;
}
The swap( ) function uses the bitwise XOR operator and does not require any temporary variable for swapping.

Enregistrer pour revision

Enregistrer pour revision

Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.

Ouvrir ma bibliotheque d'apprentissage

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Les plus utiles selon les utilisateurs :

Sujets d entretien associes

Kubernetes questions et reponses d'entretien - Total 30 questions
Microservices questions et reponses d'entretien - Total 30 questions
Apache Kafka questions et reponses d'entretien - Total 38 questions
Tableau questions et reponses d'entretien - Total 20 questions
Adobe AEM questions et reponses d'entretien - Total 50 questions
IAS questions et reponses d'entretien - Total 56 questions
PHP OOPs questions et reponses d'entretien - Total 30 questions
OOPs questions et reponses d'entretien - Total 30 questions
Fashion Designer questions et reponses d'entretien - Total 20 questions
Desktop Support questions et reponses d'entretien - Total 30 questions
CICS questions et reponses d'entretien - Total 30 questions
Yoga Teachers Training questions et reponses d'entretien - Total 30 questions
Nursing questions et reponses d'entretien - Total 40 questions
Linked List questions et reponses d'entretien - Total 15 questions
Dynamic Programming questions et reponses d'entretien - Total 30 questions
SharePoint questions et reponses d'entretien - Total 28 questions
Behavioral questions et reponses d'entretien - Total 29 questions
School Teachers questions et reponses d'entretien - Total 25 questions
Language in C questions et reponses d'entretien - Total 80 questions
Statistics questions et reponses d'entretien - Total 30 questions
Digital Marketing questions et reponses d'entretien - Total 40 questions
Apache Spark questions et reponses d'entretien - Total 24 questions
Full-Stack Developer questions et reponses d'entretien - Total 60 questions
IIS questions et reponses d'entretien - Total 30 questions
System Design questions et reponses d'entretien - Total 30 questions
VISA questions et reponses d'entretien - Total 30 questions
Google Analytics questions et reponses d'entretien - Total 30 questions
Cloud Computing questions et reponses d'entretien - Total 42 questions
BPO questions et reponses d'entretien - Total 48 questions
ANT questions et reponses d'entretien - Total 10 questions
SEO questions et reponses d'entretien - Total 51 questions
SAS questions et reponses d'entretien - Total 24 questions
Control System questions et reponses d'entretien - Total 28 questions
Agile Methodology questions et reponses d'entretien - Total 30 questions
HR Questions questions et reponses d'entretien - Total 49 questions
REST API questions et reponses d'entretien - Total 52 questions
Content Writer questions et reponses d'entretien - Total 30 questions
Banking questions et reponses d'entretien - Total 20 questions
Checkpoint questions et reponses d'entretien - Total 20 questions
Blockchain questions et reponses d'entretien - Total 29 questions
Technical Support questions et reponses d'entretien - Total 30 questions
Mainframe questions et reponses d'entretien - Total 20 questions
Hadoop questions et reponses d'entretien - Total 40 questions
Chemistry questions et reponses d'entretien - Total 50 questions
Docker questions et reponses d'entretien - Total 30 questions
Sales questions et reponses d'entretien - Total 30 questions
Nature questions et reponses d'entretien - Total 20 questions
Interview Tips questions et reponses d'entretien - Total 30 questions
College Teachers questions et reponses d'entretien - Total 30 questions
SDLC questions et reponses d'entretien - Total 75 questions
Cryptography questions et reponses d'entretien - Total 40 questions
RPA questions et reponses d'entretien - Total 26 questions
Blue Prism questions et reponses d'entretien - Total 20 questions
Memcached questions et reponses d'entretien - Total 28 questions
GIT questions et reponses d'entretien - Total 30 questions
DevOps questions et reponses d'entretien - Total 45 questions
Accounting questions et reponses d'entretien - Total 30 questions
SSB questions et reponses d'entretien - Total 30 questions
Algorithm questions et reponses d'entretien - Total 50 questions
Business Analyst questions et reponses d'entretien - Total 40 questions
Splunk questions et reponses d'entretien - Total 30 questions
Sqoop questions et reponses d'entretien - Total 30 questions
JSON questions et reponses d'entretien - Total 16 questions
OSPF questions et reponses d'entretien - Total 30 questions
Insurance questions et reponses d'entretien - Total 30 questions
Scrum Master questions et reponses d'entretien - Total 30 questions
Accounts Payable questions et reponses d'entretien - Total 30 questions
Computer Graphics questions et reponses d'entretien - Total 25 questions
IoT questions et reponses d'entretien - Total 30 questions
Bitcoin questions et reponses d'entretien - Total 30 questions
Active Directory questions et reponses d'entretien - Total 30 questions
Laravel questions et reponses d'entretien - Total 30 questions
XML questions et reponses d'entretien - Total 25 questions
GraphQL questions et reponses d'entretien - Total 32 questions

Tous les sujets d entretien

C# questions et reponses d'entretien - Total 41 questions
LINQ questions et reponses d'entretien - Total 20 questions
ASP .NET questions et reponses d'entretien - Total 31 questions
Microsoft .NET questions et reponses d'entretien - Total 60 questions
ASP questions et reponses d'entretien - Total 82 questions
IBM Watson questions et reponses d'entretien - Total 30 questions
Perplexity AI questions et reponses d'entretien - Total 40 questions
ChatGPT questions et reponses d'entretien - Total 20 questions
NLP questions et reponses d'entretien - Total 30 questions
AI Agents (Agentic AI) questions et reponses d'entretien - Total 50 questions
OpenCV questions et reponses d'entretien - Total 36 questions
Amazon SageMaker questions et reponses d'entretien - Total 30 questions
TensorFlow questions et reponses d'entretien - Total 30 questions
Hugging Face questions et reponses d'entretien - Total 30 questions
Gemini AI questions et reponses d'entretien - Total 50 questions
Artificial Intelligence (AI) questions et reponses d'entretien - Total 47 questions
Oracle AI Agents questions et reponses d'entretien - Total 50 questions
Machine Learning questions et reponses d'entretien - Total 30 questions
Google Cloud AI questions et reponses d'entretien - Total 30 questions
Scala questions et reponses d'entretien - Total 48 questions
Swift questions et reponses d'entretien - Total 49 questions
Golang questions et reponses d'entretien - Total 30 questions
Embedded C questions et reponses d'entretien - Total 30 questions
VBA questions et reponses d'entretien - Total 30 questions
C++ questions et reponses d'entretien - Total 142 questions
COBOL questions et reponses d'entretien - Total 50 questions
R Language questions et reponses d'entretien - Total 30 questions
Python Coding questions et reponses d'entretien - Total 20 questions
CCNA questions et reponses d'entretien - Total 40 questions
Oracle Cloud Infrastructure (OCI) questions et reponses d'entretien - Total 100 questions
AWS questions et reponses d'entretien - Total 87 questions
Azure Data Factory questions et reponses d'entretien - Total 30 questions
Microsoft Azure questions et reponses d'entretien - Total 35 questions
OpenStack questions et reponses d'entretien - Total 30 questions
ServiceNow questions et reponses d'entretien - Total 30 questions
Snowflake questions et reponses d'entretien - Total 30 questions
Oracle APEX questions et reponses d'entretien - Total 23 questions
PDPA questions et reponses d'entretien - Total 20 questions
OSHA questions et reponses d'entretien - Total 20 questions
HIPPA questions et reponses d'entretien - Total 20 questions
PHIPA questions et reponses d'entretien - Total 20 questions
FERPA questions et reponses d'entretien - Total 20 questions
DPDP questions et reponses d'entretien - Total 30 questions
PIPEDA questions et reponses d'entretien - Total 20 questions
CCPA questions et reponses d'entretien - Total 20 questions
GDPR questions et reponses d'entretien - Total 30 questions
HITRUST questions et reponses d'entretien - Total 20 questions
LGPD questions et reponses d'entretien - Total 20 questions
Data Structures questions et reponses d'entretien - Total 49 questions
Computer Networking questions et reponses d'entretien - Total 65 questions
Microsoft Excel questions et reponses d'entretien - Total 37 questions
Computer Basics questions et reponses d'entretien - Total 62 questions
Computer Science questions et reponses d'entretien - Total 50 questions
MS Word questions et reponses d'entretien - Total 50 questions
Operating System questions et reponses d'entretien - Total 22 questions
Tips and Tricks questions et reponses d'entretien - Total 30 questions
PoowerPoint questions et reponses d'entretien - Total 50 questions
Pandas questions et reponses d'entretien - Total 30 questions
Deep Learning questions et reponses d'entretien - Total 29 questions
PySpark questions et reponses d'entretien - Total 30 questions
Flask questions et reponses d'entretien - Total 40 questions
PyTorch questions et reponses d'entretien - Total 25 questions
Data Science questions et reponses d'entretien - Total 23 questions
SciPy questions et reponses d'entretien - Total 30 questions
Generative AI questions et reponses d'entretien - Total 30 questions
NumPy questions et reponses d'entretien - Total 30 questions
Python questions et reponses d'entretien - Total 106 questions
Python Pandas questions et reponses d'entretien - Total 48 questions
Python Matplotlib questions et reponses d'entretien - Total 30 questions
Django questions et reponses d'entretien - Total 50 questions
MariaDB questions et reponses d'entretien - Total 40 questions
DBMS questions et reponses d'entretien - Total 73 questions
Apache Hive questions et reponses d'entretien - Total 30 questions
SSIS questions et reponses d'entretien - Total 30 questions
PostgreSQL questions et reponses d'entretien - Total 30 questions
Teradata questions et reponses d'entretien - Total 20 questions
SQL Query questions et reponses d'entretien - Total 70 questions
SQLite questions et reponses d'entretien - Total 53 questions
Cassandra questions et reponses d'entretien - Total 25 questions
Neo4j questions et reponses d'entretien - Total 44 questions
MSSQL questions et reponses d'entretien - Total 50 questions
OrientDB questions et reponses d'entretien - Total 46 questions
SQL questions et reponses d'entretien - Total 152 questions
Data Warehouse questions et reponses d'entretien - Total 20 questions
IBM DB2 questions et reponses d'entretien - Total 40 questions
Data Mining questions et reponses d'entretien - Total 30 questions
Elasticsearch questions et reponses d'entretien - Total 61 questions
Oracle questions et reponses d'entretien - Total 34 questions
MongoDB questions et reponses d'entretien - Total 27 questions
AWS DynamoDB questions et reponses d'entretien - Total 46 questions
Entity Framework questions et reponses d'entretien - Total 46 questions
MySQL questions et reponses d'entretien - Total 108 questions
Data Modeling questions et reponses d'entretien - Total 30 questions
Redis Cache questions et reponses d'entretien - Total 20 questions
Data Engineer questions et reponses d'entretien - Total 30 questions
Robotics questions et reponses d'entretien - Total 28 questions
AutoCAD questions et reponses d'entretien - Total 30 questions
Power System questions et reponses d'entretien - Total 28 questions
Electrical Engineering questions et reponses d'entretien - Total 30 questions
Verilog questions et reponses d'entretien - Total 30 questions
Digital Electronics questions et reponses d'entretien - Total 38 questions
VLSI questions et reponses d'entretien - Total 30 questions
Software Engineering questions et reponses d'entretien - Total 27 questions
MATLAB questions et reponses d'entretien - Total 25 questions
Civil Engineering questions et reponses d'entretien - Total 30 questions
Electrical Machines questions et reponses d'entretien - Total 29 questions
Oracle CXUnity questions et reponses d'entretien - Total 29 questions
Web Services questions et reponses d'entretien - Total 10 questions
Salesforce Lightning questions et reponses d'entretien - Total 30 questions
IBM Integration Bus questions et reponses d'entretien - Total 30 questions
Power BI questions et reponses d'entretien - Total 24 questions
OIC questions et reponses d'entretien - Total 30 questions
Web API questions et reponses d'entretien - Total 31 questions
Dell Boomi questions et reponses d'entretien - Total 30 questions
Salesforce questions et reponses d'entretien - Total 57 questions
IBM DataStage questions et reponses d'entretien - Total 20 questions
Talend questions et reponses d'entretien - Total 34 questions
TIBCO questions et reponses d'entretien - Total 30 questions
Informatica questions et reponses d'entretien - Total 48 questions
Java Applet questions et reponses d'entretien - Total 29 questions
Java Mail questions et reponses d'entretien - Total 27 questions
Google Gson questions et reponses d'entretien - Total 8 questions
Java 21 questions et reponses d'entretien - Total 21 questions
RMI questions et reponses d'entretien - Total 31 questions
Java Support questions et reponses d'entretien - Total 30 questions
Apache Camel questions et reponses d'entretien - Total 20 questions
Struts questions et reponses d'entretien - Total 84 questions
JAXB questions et reponses d'entretien - Total 18 questions
J2EE questions et reponses d'entretien - Total 25 questions
JUnit questions et reponses d'entretien - Total 24 questions
Java OOPs questions et reponses d'entretien - Total 30 questions
Apache Tapestry questions et reponses d'entretien - Total 9 questions
JSP questions et reponses d'entretien - Total 49 questions
Java Concurrency questions et reponses d'entretien - Total 30 questions
JDBC questions et reponses d'entretien - Total 27 questions
Java 11 questions et reponses d'entretien - Total 24 questions
Java Garbage Collection questions et reponses d'entretien - Total 30 questions
Java Swing questions et reponses d'entretien - Total 27 questions
Java Design Patterns questions et reponses d'entretien - Total 15 questions
Spring Framework questions et reponses d'entretien - Total 53 questions
JPA questions et reponses d'entretien - Total 41 questions
JSF questions et reponses d'entretien - Total 24 questions
Java 8 questions et reponses d'entretien - Total 30 questions
Hibernate questions et reponses d'entretien - Total 52 questions
JMS questions et reponses d'entretien - Total 64 questions
Java 17 questions et reponses d'entretien - Total 20 questions
Java Beans questions et reponses d'entretien - Total 57 questions
Java Exception Handling questions et reponses d'entretien - Total 30 questions
Spring Boot questions et reponses d'entretien - Total 50 questions
Servlets questions et reponses d'entretien - Total 34 questions
Kotlin questions et reponses d'entretien - Total 30 questions
EJB questions et reponses d'entretien - Total 80 questions
Java 15 questions et reponses d'entretien - Total 16 questions
Java Multithreading questions et reponses d'entretien - Total 30 questions
Apache Wicket questions et reponses d'entretien - Total 26 questions
Core Java questions et reponses d'entretien - Total 306 questions
JBoss questions et reponses d'entretien - Total 14 questions
Log4j questions et reponses d'entretien - Total 35 questions
ITIL questions et reponses d'entretien - Total 25 questions
Finance questions et reponses d'entretien - Total 30 questions
JIRA questions et reponses d'entretien - Total 30 questions
SAP MM questions et reponses d'entretien - Total 30 questions
SAP ABAP questions et reponses d'entretien - Total 24 questions
SCCM questions et reponses d'entretien - Total 30 questions
Tally questions et reponses d'entretien - Total 30 questions
Pega questions et reponses d'entretien - Total 30 questions
Android questions et reponses d'entretien - Total 14 questions
Mobile Computing questions et reponses d'entretien - Total 20 questions
Xamarin questions et reponses d'entretien - Total 31 questions
iOS questions et reponses d'entretien - Total 52 questions
Ionic questions et reponses d'entretien - Total 32 questions
Kubernetes questions et reponses d'entretien - Total 30 questions
Microservices questions et reponses d'entretien - Total 30 questions
Apache Kafka questions et reponses d'entretien - Total 38 questions
Tableau questions et reponses d'entretien - Total 20 questions
Adobe AEM questions et reponses d'entretien - Total 50 questions
IAS questions et reponses d'entretien - Total 56 questions
PHP OOPs questions et reponses d'entretien - Total 30 questions
OOPs questions et reponses d'entretien - Total 30 questions
Fashion Designer questions et reponses d'entretien - Total 20 questions
Desktop Support questions et reponses d'entretien - Total 30 questions
CICS questions et reponses d'entretien - Total 30 questions
Yoga Teachers Training questions et reponses d'entretien - Total 30 questions
Nursing questions et reponses d'entretien - Total 40 questions
Linked List questions et reponses d'entretien - Total 15 questions
Dynamic Programming questions et reponses d'entretien - Total 30 questions
SharePoint questions et reponses d'entretien - Total 28 questions
Behavioral questions et reponses d'entretien - Total 29 questions
School Teachers questions et reponses d'entretien - Total 25 questions
Language in C questions et reponses d'entretien - Total 80 questions
Statistics questions et reponses d'entretien - Total 30 questions
Digital Marketing questions et reponses d'entretien - Total 40 questions
Apache Spark questions et reponses d'entretien - Total 24 questions
Full-Stack Developer questions et reponses d'entretien - Total 60 questions
IIS questions et reponses d'entretien - Total 30 questions
System Design questions et reponses d'entretien - Total 30 questions
VISA questions et reponses d'entretien - Total 30 questions
Google Analytics questions et reponses d'entretien - Total 30 questions
Cloud Computing questions et reponses d'entretien - Total 42 questions
BPO questions et reponses d'entretien - Total 48 questions
ANT questions et reponses d'entretien - Total 10 questions
SEO questions et reponses d'entretien - Total 51 questions
SAS questions et reponses d'entretien - Total 24 questions
Control System questions et reponses d'entretien - Total 28 questions
Agile Methodology questions et reponses d'entretien - Total 30 questions
HR Questions questions et reponses d'entretien - Total 49 questions
REST API questions et reponses d'entretien - Total 52 questions
Content Writer questions et reponses d'entretien - Total 30 questions
Banking questions et reponses d'entretien - Total 20 questions
Checkpoint questions et reponses d'entretien - Total 20 questions
Blockchain questions et reponses d'entretien - Total 29 questions
Technical Support questions et reponses d'entretien - Total 30 questions
Mainframe questions et reponses d'entretien - Total 20 questions
Hadoop questions et reponses d'entretien - Total 40 questions
Chemistry questions et reponses d'entretien - Total 50 questions
Docker questions et reponses d'entretien - Total 30 questions
Sales questions et reponses d'entretien - Total 30 questions
Nature questions et reponses d'entretien - Total 20 questions
Interview Tips questions et reponses d'entretien - Total 30 questions
College Teachers questions et reponses d'entretien - Total 30 questions
SDLC questions et reponses d'entretien - Total 75 questions
Cryptography questions et reponses d'entretien - Total 40 questions
RPA questions et reponses d'entretien - Total 26 questions
Blue Prism questions et reponses d'entretien - Total 20 questions
Memcached questions et reponses d'entretien - Total 28 questions
GIT questions et reponses d'entretien - Total 30 questions
DevOps questions et reponses d'entretien - Total 45 questions
Accounting questions et reponses d'entretien - Total 30 questions
SSB questions et reponses d'entretien - Total 30 questions
Algorithm questions et reponses d'entretien - Total 50 questions
Business Analyst questions et reponses d'entretien - Total 40 questions
Splunk questions et reponses d'entretien - Total 30 questions
Sqoop questions et reponses d'entretien - Total 30 questions
JSON questions et reponses d'entretien - Total 16 questions
OSPF questions et reponses d'entretien - Total 30 questions
Insurance questions et reponses d'entretien - Total 30 questions
Scrum Master questions et reponses d'entretien - Total 30 questions
Accounts Payable questions et reponses d'entretien - Total 30 questions
Computer Graphics questions et reponses d'entretien - Total 25 questions
IoT questions et reponses d'entretien - Total 30 questions
Bitcoin questions et reponses d'entretien - Total 30 questions
Active Directory questions et reponses d'entretien - Total 30 questions
Laravel questions et reponses d'entretien - Total 30 questions
XML questions et reponses d'entretien - Total 25 questions
GraphQL questions et reponses d'entretien - Total 32 questions
Ansible questions et reponses d'entretien - Total 30 questions
Electron.js questions et reponses d'entretien - Total 24 questions
ES6 questions et reponses d'entretien - Total 30 questions
RxJS questions et reponses d'entretien - Total 29 questions
NodeJS questions et reponses d'entretien - Total 30 questions
Vue.js questions et reponses d'entretien - Total 30 questions
ExtJS questions et reponses d'entretien - Total 50 questions
jQuery questions et reponses d'entretien - Total 22 questions
Svelte.js questions et reponses d'entretien - Total 30 questions
Shell Scripting questions et reponses d'entretien - Total 50 questions
Next.js questions et reponses d'entretien - Total 30 questions
Knockout JS questions et reponses d'entretien - Total 25 questions
TypeScript questions et reponses d'entretien - Total 38 questions
PowerShell questions et reponses d'entretien - Total 27 questions
Terraform questions et reponses d'entretien - Total 30 questions
JCL questions et reponses d'entretien - Total 20 questions
JavaScript questions et reponses d'entretien - Total 59 questions
Ajax questions et reponses d'entretien - Total 58 questions
Express.js questions et reponses d'entretien - Total 30 questions
Ethical Hacking questions et reponses d'entretien - Total 40 questions
Cyber Security questions et reponses d'entretien - Total 50 questions
PII questions et reponses d'entretien - Total 30 questions
Data Protection Act questions et reponses d'entretien - Total 20 questions
BGP questions et reponses d'entretien - Total 30 questions
Ubuntu questions et reponses d'entretien - Total 30 questions
Linux questions et reponses d'entretien - Total 43 questions
Unix questions et reponses d'entretien - Total 105 questions
Weblogic questions et reponses d'entretien - Total 30 questions
Tomcat questions et reponses d'entretien - Total 16 questions
Glassfish questions et reponses d'entretien - Total 8 questions
TestNG questions et reponses d'entretien - Total 38 questions
Postman questions et reponses d'entretien - Total 30 questions
SDET questions et reponses d'entretien - Total 30 questions
UiPath questions et reponses d'entretien - Total 38 questions
Quality Assurance questions et reponses d'entretien - Total 56 questions
Selenium questions et reponses d'entretien - Total 40 questions
Kali Linux questions et reponses d'entretien - Total 29 questions
Mobile Testing questions et reponses d'entretien - Total 30 questions
API Testing questions et reponses d'entretien - Total 30 questions
Appium questions et reponses d'entretien - Total 30 questions
ETL Testing questions et reponses d'entretien - Total 20 questions
QTP questions et reponses d'entretien - Total 44 questions
Cucumber questions et reponses d'entretien - Total 30 questions
PHP questions et reponses d'entretien - Total 27 questions
Oracle JET(OJET) questions et reponses d'entretien - Total 54 questions
Frontend Developer questions et reponses d'entretien - Total 30 questions
Zend Framework questions et reponses d'entretien - Total 24 questions
RichFaces questions et reponses d'entretien - Total 26 questions
HTML questions et reponses d'entretien - Total 27 questions
Flutter questions et reponses d'entretien - Total 25 questions
CakePHP questions et reponses d'entretien - Total 30 questions
React questions et reponses d'entretien - Total 40 questions
React Native questions et reponses d'entretien - Total 26 questions
Angular JS questions et reponses d'entretien - Total 21 questions
Web Developer questions et reponses d'entretien - Total 50 questions
Angular 8 questions et reponses d'entretien - Total 32 questions
Dojo questions et reponses d'entretien - Total 23 questions
GWT questions et reponses d'entretien - Total 27 questions
Symfony questions et reponses d'entretien - Total 30 questions
Ruby On Rails questions et reponses d'entretien - Total 74 questions
CSS questions et reponses d'entretien - Total 74 questions
Yii questions et reponses d'entretien - Total 30 questions
Angular questions et reponses d'entretien - Total 50 questions
Copyright © 2026, WithoutBook.