text:
void main ()
{ int i = 0 , a[3] ;
a[i] = i++;
printf ("%d",a[i]) ;
Ans: 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.
2. Why doesn't the following code give the desired result?
3. Why doesn't the following statement work?
4. How do I know how many elements an array can hold?
Ans: 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] ;
#include <stdio.h>
#include <dos.h>
main( )
char far *scr = 0xB8000000 ;
FILE *fp ;
int offset ;
char ch ;
#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" ) ;
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" )
printf ( "\nStrings arr1 and arr2 compared using memicmp are not
identical" ) ;
7. Fixed-size objects are more appropriate as compared to variable size data
objects. Using variable-size data objects saves very little space. Variable size
data objects usually have some overhead. Manipulation of fixed-size data
objects is usually faster and easier. Use fixed size when maximum size is
clearly bounded and close to average. And use variable-size data objects when
a few of the data items are bigger than the average size. For example,
char *num[10] = { "One", "Two", "Three", "Four",
"Five", "Six", "Seven", "Eight", "Nine", "Ten" } ;
The first form uses variable-size data objects. It allocates 10 pointers, which
are pointing to 10 string constants of variable size. Assuming each pointer is of
4 bytes, it requires 90 bytes. On the other hand, the second form uses fixed
size data objects. It allocates 10 arrays of 6 characters each. It requires only 60
bytes of space. So, the variable-size in this case does not offer any advantage
over fixed size.
8. 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 */
/* Spawn.c */
#include <process.h>
#include <stdio.h>
main( )
int val ;
val = spawnl ( P_WAIT, "C:\\Mult.exe", "3", "10",
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.
const int x = 10 ;
int arr[x] ;
Ans: 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
11. How do I write code to retrieve current date and time from the system and
display it as a string?
Ans: 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 <sys\types.h>
void main( )
time_t curtime ;
char ctm[50] ;
Ans: 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 ) ;
How do I write code that would get error number and display error message if
any standard error occurs?
#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.
14. How do I write code to get the current drive as well as set the current
Ans: 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: %c\n", 65 + dno
maxdr = setdisk ( 3 ) ;
dno = getdisk( ) ;
printf ( "\nNow the current drive is: %c\n", 65 +
dno ) ;
15. 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 ;
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" ) ;
16. How do I write code to find an amount of free disk space available on
current drive?
#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 failed\n");
exit ( 1 ) ;
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.
#include <stdio.h>
#include <stdlib.h>
void fun1( )
printf("Inside fun1\n");
void fun2( )
printf("Inside fun2\n");
main( )
atexit ( fun1 ) ;
/* some code */
atexit ( fun2 ) ;
printf ( "This is the last statement of
program?\n" );
22. How do I determine amount of memory currently available for allocating?
Ans: 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.
23. How does a C program come to know about command line arguments?
Ans: 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.
24. When we open a file, how does functions like fread( )/fwrite( ), etc. get to
know from where to read or to write the data?
Ans: 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.
25.The sizeof( ) function doesn't return the size of the block of memory
pointed to by a pointer. Why?
Ans: 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( ).
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 <dos.h>
main( )
unsigned s, o ;
char far *ptr = "Hello!" ;
s = FP_SEG ( ptr ) ;
o = FP_OFF ( ptr ) ;
printf ( "\n%u %u", s, o ) ;
27. How do I write a program to convert a string containing number in a
hexadecimal form to its equivalent decimal?
Ans: The following program demonstrates this:
main( )
char str[] = "0AB" ;
int h, hex, i, n ;
for ( i = 0 ; h == 1 ; i++ )
if ( str[i] >= '0' && str[i] <= '9' )
hex = str[i] - '0' ;
if ( str[i] >= 'a' && str[i] <= 'f' )
hex = str[i] - 'a' + 10 ;
if ( str[i] >= 'A' && str[i] <= 'F' )
hex = str[i] - 'A' + 10 ;
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.
28. How do I write code that reads the segment register settings?
Ans: 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 ) ;
29. What is environment and how do I get environment for a specific entry?
main( )
char *path = NULL ;
30. How do I display current date in the format given below?
#include <stdio.h>
#include <time.h>
main( )
struct tm *curtime ;
time_t dtime ;
char str[30] ;
time ( &dtime ) ;
curtime = localtime ( &dtime ) ;
strftime ( str, 30, "%A %B %d, %Y", curtime ) ;
int arr[5] ;
int arrsz = sizeof ( arr ) ;
#define SZ 5
#include "myheader.h"
int arr[SZ] ;
#include "myheader.h"
extern int arr[SZ] ;
32. How do I write printf( ) so that the width of a field can be specified at
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.
33. How to find the row and column dimension of a given 2-D array?
Ans: 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 } ;
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] ;
if ( access ( fname, 0 ) != 0 )
printf ( "\nFile does not exist." ) ;
return ;
35. How do I convert a floating-point number to a string?
main( )
char str[25] ;
float no ;
int dg = 5 ; /* significant digits */
no = 14.3216 ;
gcvt ( no, dg, str ) ;
printf ( "String: %s\n", str ) ;
What is a stack ?
#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 ( "\n\n" ) ;
Data Structures
How to distinguish between a binary tree and a tree?
Ans: 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.
38. How do I use the function ldexp( ) in a program?
Ans: 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 : %lf\n", ans ) ;
Here, ldexp( ) function would get expanded as ( 4 * 2 * 2 ), and the output
would be the ldexp value is : 16.000000
39.Can we get the mantissa and exponent form of a given number?
Ans: 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 ) ;
return 0 ;
40. How do I write code that executes certain function only at program
Ans: 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( ) ;
41. What are memory models?
Ans: 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.
42. How does C compiler store elements in a multi-dimensional array?
( ( i < 10 ) ? j : k ) = l * 2 + p ;
Ans: 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 ) ;
Ans: The following code snippet shows how to get the day of week from the
given date.
void main( )
printf ( "\n\n\nDay of week : %d ", dayofweek ( 2002, 5, 18 ) ) ;
45. What's the difference between these two declarations?
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.
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 ;
48. What would the second and the third printf( ) output the following
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] ) ;
Ans: 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.
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.
The suppression character * suppresses the input read from the standard input
buffer for the assigned control character.
50. How do I print a floating-point number with higher precision say
23.34568734 with only precision up to two decimal places?
Ans: 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.
51. Are the expressions *ptr++ and ++*ptr same?
Ans: No. *ptr++ increments the pointer and not the value pointed by it,
whereas ++*ptr increments the value being pointed to by ptr.
52. 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 ) ;
printf ( "The character not found" ) ;
The output of the above program would be the first character found in str1 is e
53. Can we convert an unsigned long integer value to a string?
Ans: 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 '\0') 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] ;
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 ) ;
#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 = %d\n", str, dec, sign ) ;
val = -345.67 ;
ndig = 8 ;
str = ecvt ( val, ndig, &dec, &sign ) ;
printf ( "string = %s dec = %d sign = %d\n", str, dec, sign ) ;
Ans: 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
if ( argc < 2 )
exit ( 0 ) ;
#include <conio.h>
main( )
int i, j ;
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 ;
Ans: 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: %c\n", disk ) ;
61. How come the output for both the programs is different when the logic is
main( )
int i, j ;
main( )
int 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.
62. Can we get the x and y coordinate of the current cursor position ?
Ans : 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 ( "Just\n To\n Test\n Where\n the cursor\n goes" ) ;
Ans: 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 %d\r\n", i ) ;
printf ( "Press a key to continue : " ) ;
getch( ) ;
gotoxy ( 2, 6 ) ;
for ( i = 6; i <= 12; i++ )
delline( ) ;
getch( ) ;
64. How do I get the time elapsed between two function calls ?
Ans: 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.
65. How do I use swab( ) in my program ?
Ans: 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 : %s\n", str2 ) ; // output -- She sells
snails on the sea shore
getch( ) ;
66. Turbo C provides various command line compiler options which we can use
through TCC. The compiler options include : displaying specific warning
messages, generating 8087 hardware instructions, using a filename for
generating assembly code, etc. Instead of compiler options being executed at
command line we can use these compiler options in our program. This can be
achieved using #pragma options. We can use various flags with #pragma
options to use the compiler options. All these flags are available in turbo C's
online help.
67. I have an array declared in file 'F1.C' as,
int a[ ] = { 1, 2, 3, 4, 5, 6 } ;
and used in the file 'F2.C' as,
extern int a[ ] ;
#define ARR_SIZ 6
In file F1.C declare as,
#include "F1.H"
int a[ ARR_SIZ ] ;
and in file F2.C declare as,
#include "F1.H"
extern int a[ ARR_SIZ ] ;
3. In file 'F1.C' define as,
int a[ ] = { 1, 2, 3, 4, 5, 6, -1 } ;
Ans: Sometimes, specially when we are creating a text editor like program we
may wish to allow user to delete a line. We can do so by using two functions
namely clreol( ) and delline( ). The clreol( ) function deletes the line from the
current cursor position to the end of line. The delline() function deletes the
entire line at the current cursor position and
moves up the following line. Following program shows how to use these
#include <conio.h>
main( )
int i ;
getch( ) ;
gotoxy ( 1, 7 ) ;
clreol( ) ;
getch( ) ;
gotoxy ( 1, 12 ) ;
delline( ) ;
getch( ) ;
69. How do I programmatically insert lines in the text window?
Ans: We can insert a blank line in the text window using the insline( ) function.
This function inserts line at current cursor position. While doing so, it shifts
down the lines that are below the newly inserted line.
#include <conio.h>
void main( )
printf ( "The little snail was slowly moving up. She wanted\r\n" ) ;
printf ( "to reach the top of the tree. It was chilly\r\n" ) ;
printf ( "winter season. Most of the animals were resting in\r\n" ) ;
printf ( "their nests as there was a heavy snow fall.\r\n" ) ;
printf ( "\r\nPress any key to continue:" ) ;
gotoxy ( 10, 2 ) ;
getch( ) ;
insline( ) ;
getch( ) ;
main( )
unsigned int num ;
int i ;
Ans: The output of this program is the binary equivalent of the given number.
We have used bitwise operators to get the binary number.
71. Graphics
In text mode the mouse cursor appears as a block, whereas in graphics mode
it appears as an arrow. If we wish we can change the graphics cursor to any
other shape the way Windows does. The mouse cursor in graphics mode
occupies a 16 by 16 pixel box. By highlighting or dehighlighting some of the
pixels in this box we can get the desired shape. For example, the following bit-
pattern can be used to generate the cursor which looks like an hour-glass.
1111111111111111 0000000000000000
1000000000000001 0000000000000000
1111111111111111 0000000000000000
1000000000000001 0000000000000000
0100000000000010 1000000000000001
0010000000000100 1100000000000011
0000100000010000 1111000000001111
0000001001000000 1111110000111111
0000001001000000 1111110000111111
0000100000010000 1111000000001111
0010000000000100 1100000000000011
0100000000000010 1000000000000001
1000000000000001 0000000000000000
1111111111111111 0000000000000000
1000000000000001 0000000000000000
1111111111111111 0000000000000000
Mouse pointer bitmap Screen Mask the one's in the mouse pointer bitmap
indicate that the pixel would be drawn whereas the zeros indicate that the
pixel would stand erased. It is important to note that the mouse pointer bit
pattern is 32 bytes long. However, while actually writing a program to change
the pointer shape we need a 64 byte bit-map. This provision is made to ensure
that when the cursor reaches a position on the screen where something is
already written or drawn only that portion should get overwritten which is
to be occupied by the mouse cursor. Of the 64 bytes the first 32 bytes contain
a bit mask which is first ANDed with the screen image, and then the second 32
bytes bit mask is XORed with the screen image.
# include "graphics.h"
# include "dos.h"
union REGS i, o ;
struct SREGS s ;
int cursor[32] =
/* Hour-glass screen mask */
0x0000, 0x0000, 0x0000, 0x0000,
0x8001, 0xc003, 0xf00f, 0xfc3f,
0xfc3f, 0xf00f, 0xc003, 0x8001,
0x0000, 0x0000, 0x0000, 0x0000,
/* The mouse pointer bitmap */
0xffff, 0x8001, 0xffff, 0x8001,
0x4002, 0x2004, 0x1008, 0x0240,
0x0240, 0x0810, 0x2004, 0x4002,
0x8001, 0xffff, 0x8001, 0xffff,
main( )
int gd = DETECT, gm ;
initgraph ( &gd, &gm, "c:\\tc\\bgi" ) ;
if ( initmouse( ) == -1 )
closegraph( ) ;
printf ( "\n Mouse not installed!" ) ;
exit( ) ;
gotoxy ( 10, 1 ) ; printf ( "Press any key to exit..." ) ;
changecursor ( cursor ) ; showmouseptr( ) ;
getch( ) ;
initmouse( )
i.x.ax = 0 ; int86 ( 0x33, &i, &o ) ;
return ( o.x.ax == 0 ? -1 : 0 ) ;
showmouseptr( )
i.x.ax = 1 ; int86 ( 0x33, &i, &o ) ;
changecursor ( int *shape )
i.x.ax = 9 ; /* service number */
i.x.bx = 0 ; /* actual cursor position from left */
i.x.cx = 0 ; /* actual cursor position from top */
i.x.dx = ( unsigned ) shape ; /* offset address of pointer image*/
segread ( &s ) ;
s.es = s.ds ; /* segment address of pointer */
int86x ( 0x33, &i, &i, &s ) ;
Suppose there are three pegs labeled A, B and C. Four disks are placed on peg
A. The bottom-most disk is largest, and disks go on decreasing in size with the
topmost disk being smallest. The objective of the game is to move the disks
from peg A to peg C, using peg B as an auxiliary peg. The rules of the game
are as follows:
Only one disk may be moved at a time, and it must be the top disk on one of
the pegs. A larger disk should never be placed on the top of a smaller disk.
Suppose we are to write a program to print out the sequence in which the disks
should be moved such that all disks on peg A are finally transferred to peg C.
Here it is...
main( )
int n = 4 ;
move ( n, 'A', 'B', 'C' ) ;
Move from A to B
Move from A to C
Move from B to C
Move from A to B
Move from C to A
Move from C to B
Move from A to B
Move from A to C
Move from B to C
Move from B to A
Move from C to A
Move from B to C
Move from A to B
Move from A to C
Move from B to C
This problem is the famous Towers of Hanoi problem, wherein three pegs are
to be employed for transferring the disks with the given criteria. Here's how we
go about it. We have three pegs: the starting peg, sp, the auxiliary peg ap, and
the ending peg, ep, where the disks must finally be. First, using the ending
peg as an auxiliary or supporting peg, we transfer all but the last disk to
ap. Next the last disk is moved from sp to ep. Now, using sp as the supporting
peg, all the disks are moved from ap to ep. 'A', B and C denote the three pegs.
The recursive function move( ) is called with different combinations of these
pegs as starting, auxiliary and ending pegs.
struct syntax
int i ;
float g ;
char c ;
main( )
printf ( "I won't give you any error" ) ;
Ans: The above program would get compiled successfully and on execution it
would print the message given in printf(). What strikes in the above code
snippet is the structure syntax which is declared but not terminated with the
statement terminator, the semicolon. The compiler would not give any error
message for it, as it assumes that main( ) function have a return type of struct
syntax and hence would successfully compile and execute the program.
#include <stdio.h>
#include <bios.h>
main( )
int memsize;
memsize = biosmemory( ) ;
printf ( "RAM size = %dK\n",memsize ) ;
return 0 ;
The function biosmemory uses BIOS interrupt 0x12 to return the size of
Float Format
How does C compiler stores float values ?
Ans: In C, the float values are stored in a mantissa and exponent form. While
writing a number we specify the exponent part in the form of base 10. But, in
case of C compiler, the exponent for floats is stored in the form of base 2.
Obviously, because, computer stores the numbers in binary form. The C
compiler follows an IEEE standard to store a float. The IEEE format expresses a
floating-point number in a binary form known as `normalized' form.
Normalization involves adjusting the exponent so that the "binary point" (the
binary analog of the decimal point) in the mantissa always lies to the right of
most significant nonzero digit. In binary representation, this means that the
most significant digit of the mantissa is always a 1. This property of the
normalized representation is exploited by the IEEE format when storing the
mantissa. Let us consider an example of generating the normalized form of a
floating point number. Suppose we want to represent the decimal number
5.375. Its binary equivalent can be obtained as shown below:
.375 x 2 = 0.750 0
.750 x 2 = 1.500 1
2|2 1
.500 x 2 = 1.000 1
2|1 0
|0 1
Writing remainders in reverse writing whole parts in the same order we get
101 order in which they are obtained we get 011 thus the binary
equivalent of 5.375 would be 101.011. The normalized form of this binary
number is obtained by adjusting the exponent until the decimal point is to the
right of most significant 1. In this case the result is 1.01011 x 22. The IEEE
format for floating point storage uses a sign bit, a mantissa and an exponent
for representing the power of 2. The sign bit denotes the sign of the number: a
0 represents a positive value and a 1 denotes a negative value. The
mantissa is represented in binary. Converting the floating-point number to its
normalized form results in a mantissa whose most significant digit is always 1.
The IEEE format takes advantage of this by not storing this bit at all. The
exponent is an integer stored in unsigned binary format after adding a positive
integer bias. This ensures that the stored exponent is always positive. The
value of the bias is 127 for floats and 1023 for doubles. Thus, 1.01011 x 22 is
represented as shown below:
--- --------------- ----------------------------------------------
| 0 | 100 0000 1 | 010 1100 0000 0000 0000 0000 |
--- ---------------- ---------------------------------------------
sign bit exponent- mantissa stored in normalized form obtained after
adding a bias
127 to exponent 2
Data Structures
Ans: There is no sorting method that is universally superior to all others. The
programmer must carefully examine the problem and the desired results
before deciding the particular sorting method. Some of the sorting methods
are given below:
Bubble sort : When a file containing records is to be sorted then Bubble sort is
the best sorting method when sorting by address is used.
Quick Sort : In the virtual memory environment, where pages of data are
constantly being swapped back and forth between external and internal
storage. In practical situations, quick sort is often the fastest available because
of its low overhead and its average behavior.
Heap sort : Generally used for sorting of complete binary tree. Simple insertion
sort and straight selection sort : Both are more efficient than bubble sort.
Selection sort is recommended for small files when records are large and for
reverse situation insertion sort is recommended. The heap sort and quick sort
are both more efficient than insertion or selection for large number of data.
Radix sort : It is reasonably efficient if the number of digits in the keys is not
too large.
When a file gets stored on the disk, at a time DOS allocates one cluster for it. A
cluster is nothing but a group of sectors. However, since all file sizes cannot be
expected to be a multiple of 512 bytes, when a file gets stored often part of
the cluster remains unoccupied. This space goes waste unless the file size
grows to occupy these wasted bytes. The
following program finds out how much space is wasted for all files in all the
directories of the current drive.
#include <dir.h>
#include <dos.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
unsigned bytes_per_cluster ;
unsigned long wasted_bytes ;
unsigned long num_files = 0 ;
main( )
int ptr = 0, flag = 0, first = 0 ;
struct ffblk f[50] ;
struct dfree free ;
/* get cluster information and calculate bytes per cluster */
getdfree ( 0, &free ) ;
bytes_per_cluster = free.df_bsec * free.df_sclus ;
chdir ( "\\" ) ;
/* check out files in root directory first */
cal_waste( ) ;
/* loop until all directories scanned */
while ( ptr != -1 )
/* should I do a findfirst or a findnext? */
if ( first == 0 )
flag = findfirst ( "*.*", &f[ptr], FA_DIREC ) ;
flag = findnext ( &f[ptr] ) ;
while ( flag == 0 )
/* make sure its a directory and skip over . & .. entries */
if ( f[ptr].ff_attrib == FA_DIREC && f[ptr].ff_name[0] != '.' )
flag = chdir ( f[ptr].ff_name ) ; /* try changing directories */
if ( flag == 0 ) /* did change dir work? */
cal_waste( ) ;
first = 0 ; /* set for findfirst on next pass */
break ;
flag = findnext ( &f[ptr] ) ; /* search for more dirs */
if ( flag != 0 || ptr == 49 ) /* didn't find any more dirs */
ptr-- ;
chdir ( ".." ) ; /* go back one level */
first = 1 ; /* set to findnext on next pass */
ptr++ ;
printf ( "There are %lu bytes wasted in %lu files.\n", wasted_bytes,
num_files ) ;
cal_waste( )
int flag = 0 ;
long full_cluster ;
struct ffblk ff ;
/* look for all file types */
flag = findfirst ( "*.*", &ff, FA_RDONLY | FA_HIDDEN | FA_SYSTEM |
while ( flag == 0 )
num_files++ ;
full_cluster = ff.ff_fsize / bytes_per_cluster * bytes_per_cluster ;
wasted_bytes += bytes_per_cluster - ( ff.ff_fsize - full_cluster ) ;
flag = findnext ( &ff ) ;
Data Structures
Polish Notation
The method of writing all operators either before their operation, or after them,
is called Polish notation, in honor of its discoverer, the Polish mathematician
Jan Lukasiewicz. When the operators are written before their operands, it is
called the prefix form. When the operators come after their operands. It is
called the postfix form, or, sometimes reverse Polish form or suffix form. In this
context, it is customary to use the coined phrase infix form to denote the usual
custom of writing binary operators between their operands. For example, the
expression A + B becomes +AB in prefix form and AB+ in postfix form. In the
expression A + B x C, the multiplication is done first, so we convert it first,
obtaining first A + ( BCx ) and then ABCx+ in postfix form. The prefix form of
this expression is +A x BC. The prefix and postfix forms are not related by
taking mirror images or other such simple transformation. Also all parentheses
have been omitted in the Polish forms.
The Longjmp And Setjmp
The C programming language does not let you nest functions. You cannot write
a function definition inside another function definition, as in:
int fun1( )
int fun2() /* such nesting of functions is not allowed */
Because of this restriction it is not possible to hide function names inside a
hierarchy. As a result all the functions that you declare within a program are
visible to each other. This of course is not a major drawback since one can limit
visibility by grouping functions within separate C source files that belong to
different logical units of the program. C does, however, suffer in another way
because of this design decision. It provides no easy way to transfer control out
of a function except by returning to the expression that called the function. For
the vast majority of function calls, that is a desirable limitation. You want the
discipline of nested function calls and returns to help you understand flow of
control through a program. Nevertheless, on some occasions that discipline is
too restrictive. The program is sometimes easier to write, and to understand, if
you can jump out of one or more function invocations at a single stroke. You
want to bypass the normal function returns and transfer control to somewhere
in an earlier function invocation.
For example, you may want to return to execute some code for error recovery
no matter where an error is detected in your application. The setjmp and the
longjmp functions provide the tools to accomplish this. The setjmp function
saves the "state" or the "context" of the process and the longjmp uses the
saved context to revert to a previous point in the program. What is the
context of the process? In general, the context of a process refers to
information that enables you to reconstruct exactly the way the process is at a
particular point in its flow of execution. In C program the relevant information
includes quantities such as values of SP, SS, FLAGS, CS, IP, BP, DI, ES, SI and
DS registers.
To save this information Turbo C uses the following structure, which is defined,
in the header file 'setjmp.h'.
typedef struct
unsigned j_sp ;
unsigned j_ss ;
unsigned j_flag ;
unsigned j_cs ;
unsigned j_ip ;
unsigned j_bp ;
unsigned j_di ;
unsigned j_es ;
unsigned j_si ;
unsigned j_ds ;
} jmp_buf[1] ;
This is a system-dependent data type because different systems might require
different amounts of information to capture the context of a process. In Turbo
C, jmp_buf is simply an array of ten 2-byte integers. To understand the
mechanics of setjmp and longjmp, look at the following code
#include "setjmp.h"
jmp_buf buf ;
main( )
if ( setjmp ( buf ) == 0 )
process( ) ;
handle_error( ) ; /* executed when longjmp is called */
process( )
int flag = 0 ;
/* some processing is done here */
/* if an error occurs during processing flag is set up */
if ( flag )
longjmp ( buf, 1 ) ;
Upon entry to setjmp the stack contains the address of the buffer buf and the
address of the if statement in the main function, to which setjmp will return.
The setjmp function copies this return address as well as the current values of
registers, SP, SS, FLAGS, BP, DI, ES, SI and DS, into the buffer buf. Then setjmp
returns with a zero. In this case, the if statement is satisfied and the process( )
function is called. If something goes wrong in process( ) (indicated by the flag
variable), we call longjmp with two arguments: the first is the buffer that
contains the context to which we will return. When the stack reverts back to
this saved state, and the return statement in longjmp is executed, it will be as
if we were returning from the call to setjmp, which originally saved the
buffer buf. The second argument to longjmp specifies the return value to be
used during this return. It should be other than zero so that in the if statement
we can tell whether the return is induced by a longjmp.
Comparison Trees...
The comparison trees also called decision tree or search tree of an algorithm,
is obtained by tracing through the actions of the algorithm, representing each
comparison of keys by a vertex of the tree (which we draw as a circle). Inside
the circle we put the index of the key against which we are comparing the
target key. Branches (lines) drawn down from the circle represent the
possible outcomes of the comparison and are labeled accordingly. When the
algorithm terminates, we put either F (for failure) or the location where the
target is found at the end of the appropriate branch, which we call a leaf, and
draw as a square. Leaves are also sometimes called end vertices or external
vertices of the tree. The remaining vertices are called the internal vertices of
the tree. The comparison tree for sequential search is especially simple.
Ans. This can achieved through the use of suppression char '*' in the format
string of printf( ) which is shown in the following program.
main( )
int p = 2 ;
float n = 12.126487687 ;
printf ( "%.*f",p, n ) ;
All programs that we execute from DOS prompt can be thought of as children
of COMMAND.COM. Thus, the program that we execute is a child process,
whereas COMMAND.COM running in memory is its parent. The process of a
parent process giving birth to a child process is known as 'spawning'. If the
spawned program so desires, it may in turn spawn children of its own, which
then execute and return control to their parent. Who is the parent of
COMMAND.COM? COMMAND.COM itself. We can trace the ancestors of our
program using the field Parent Process ID (PID) present at offset 0x16 in the
Program Segment Prefix (PSP). To trace this ancestry our program should
first locate its PSP, extract the parent process ID from it and then use this to
find PSP of the parent. This process can be repeated till we reach
COMMAND.COM (process ID of COMMAND.COM is its own PSP), the father of all
processes. Here is a program which achieves this...
#include "dos.h"
main( )
oldpsp = _psp ;
while ( 1 )
printf ( "\n" ) ;
printname ( oldpsp ) ;
printf ( " spawned by " ) ;
printname ( newpsp ) ;
On running the program from within TC the output obtained is shown below.
SPWAN.EXE (58A9) spawned by TC.EXE (0672) TC.EXE (0672) spawned by
COMMAND.COM (05B8). The program simply copies its own process ID in the
variable oldpsp and then uses it to extract its own filename from its
environment block. This is done by the function printname( ). The value in
oldpsp is then used to retrieve the parent's PID in newpsp. From there the
program loops reporting the values of oldpsp, newpsp and the corresponding
file names until the program reaches COMMAND.COM.
The printname( ) function first locates the environment block of the program
and then extracts the file name from the environment block. The fnsplit( )
function has been used to eliminate the path present prior to the file name. Do
not run the program from command line since it would give you only one level
of ancestry.
Data Structures
Choosing the data structures to be used for information retrieval. For problems
of information retrieval, consider the size, number, and location of the records
along with the type and structure of the keys while choosing the data
structures to be used. For small records, high-speed internal memory will be
used, and binary search trees will likely prove adequate. For information
retrieval from disk files, methods employing multiway branching, such as
trees, B-trees , and hash tables, will usually be superior. Tries are particularly
suited to applications where the keys are structured as a sequence of symbols
and where the set of keys is relatively dense in the set of all possible keys. For
other applications, methods that treat the key as a single unit will often prove
superior. B-trees, together with various generalization and extensions, can be
usefully applied to many problems concerned with external information
Thus, C can deal with variably dimensioned 1-D arrays, but when an array has
more than one dimension, the C compiler has to know the size of the last
dimensions expressed as a constant. This problem has long been
recognized, and some of the solutions that are often used are:
Declare the arrays in the functions to be big enough to tackle all possible
situations. This can lead to a wastage of lot of precious memory in most cases.
Another solution is to construct multiple-dimension array as an array of
pointers. For example, a matrix (2-D array) of floats can be declared as a 1-D
array of float pointers, with each element pointing to an array of floats. The
problem with this method is that the calling function has to define all arrays in
this fashion. This means that any other computations done on the arrays must
take this special structure into account.
Another easy solution, though seldom used, exists. This is based on the
following method:
Pass the array to the function as though it is a pointer to an array of floats (or
the appropriate data type), no matter how many dimensions the array actually
has, along with the dimensions of the array. Reference individual array
elements as offsets from this pointer.
Write your algorithm so that array elements are accessed in storage order. The
following program for multiplying two matrices illustrates this
# define M 3
# define N 2
# define P 4
mulmat ( M, N, P, a, b, c ) ;
for ( i = 0 ; i < M ; i++ )
printf ( "\n" ) ;
for ( j = 0 ; j < P ; j++ )
printf ( "%f\t", c[i][j] ) ;
void mulmat ( int m, int n, int p, float *a, float *b, float *c )
float *ptrtob, *ptrtoc ;
int i, j, k, nc ;
For example, the following data about an employee can be easily stored
using bit fields.
male or female
single, married, divorced or widowed
have one of the eight different hobbies
can choose from any of the fifteen different schemes proposed by the
company to pursue his/her hobby.
This means we need one bit to store gender, two to store marital status, three
for hobby, and four for scheme (with one value used for those who are not
desirous of availing any of the schemes). We need ten bits altogether, which
means we can pack all this information into a single integer, since an integer is
16 bits long.
At times we may need to store several True or False statuses. In such cases
instead of using bit fields using an array of bits would be more sensible. On this
array we may be required to perform the following operations:
#define CHARSIZE 8
#define MASK ( y ) ( 1 << y % CHARSIZE )
#define BITSLOT ( y ) ( y / CHARSIZE )
#define SET ( x, y ) ( x[BITSLOT( y )] |= MASK( y ) )
#define CLEAR ( x, y ) ( x[BITSLOT( y )] &= ~MASK( y ) )
#define TEST ( x, y ) ( x[BITSLOT( y )] & MASK( y ) )
#define NUMSLOTS ( n ) ( ( n + CHARSIZE - 1) / CHARSIZE )
char arr[NUMSLOTS(50)] ;
To set the 20th bit we can say,
SET(arr, 20 ) ;
And if we are to test the status of 40th bit we may say,
if ( TEST ( arr, 40 ) )
Using bit arrays often results into saving a lot of precious memory. For
example, the following program which implements the Sieve of Eratosthenes
for generating prime numbers smaller than 100 requires only 13 bytes. Had
we implemented the same logic using an array of integers we would have
required an array of 100 integers, that is 200 bytes.
#include <stdio.h>
#include <string.h>
#include <alloc.h>
typedef int element ;
void initialize_stack ( struct node ** ) ;
void push ( struct node **, element ) ;
element pop ( struct node * ) ;
int isempty ( struct node * ) ;
struct node
element data ;
struct node *next ;
void main( )
struct node *top ;
element num ;
initialize_stack ( &top ) ;
push ( &top, 10 ) ;
push ( &top, 20 ) ;
push ( &top, 30 ) ;
if ( isempty ( top ) )
printf ( "\nStack is empty" ) ;
num = pop ( top ) ;
printf ( "\n Popped %d", num ) ;
void initialize_stack ( struct node **p )
*p = NULL ;
void push ( struct node **p, element n )
struct node *r ;
r = ( struct node *) malloc ( sizeof ( struct node ) ) ;
r -> data = n ;
if ( *p == NULL )
r -> next = NULL ;
r -> next = *p ;
*p = r ;
element pop ( struct node *p )
element n ;
struct node *r ;
n = p -> data ;
p = p -> next ;
free ( r ) ;
return ( n ) ;
int isempty ( struct node *p )
if ( p == NULL )
return ( -1 ) ;
return ( 0 ) ;
Notice how the specific implementation of the data structure is strewn
throughout main( ). main( ) must see the definition of the structure node to
use the push( ), pop( ), and other stack functions. Thus the implementation is
not hidden, but is mixed with the abstract operations.
Data Structures
Radix Sort
This sorting technique is based on the values of the actual digits in the
positional representations of the numbers being sorted. Using the decimal
base, for example, where the radix is 10, the numbers can be partitioned into
ten groups on the sorter. For example, to sort a collection of numbers where
each number is a four-digit number, then, All the numbers are first sorted
according to the the digit at unit's place.
In the second pass, the numbers are sorted according to the digit at
tenth place. In the third pass, the numbers are sorted according to the digit at
hundredth place. In the forth and last pass, the numbers are sorted according
to the digit at thousandth place.
During each pass, each number is taken in the order in which it appears
in partitions from unit's place onwards. When these actions have been
performed for each digit, starting with the least significant and ending with
most significant, the numbers are sorted. This sorting method is called the
radix sort.
Let us take another example. Suppose we have a list of names. To sort these
names using radix sort method we will have to classify them into 26 groups
The list is first sorted on the first letter of each name, i.e. the names are
arranged in 26 classes, where the first class consists of those names that begin
with alphabet 'A', the second class consists of those names that begin with
alphabet 'B' and so on. During the second pass each class is alphabetized
according to the second letter of the name, and so on.
Exception Handling in C
#include <math.h>
void main( )
float i ;
i = pow ( -2, 3 ) ;
printf ( "%f", i ) ;
Data Structures
AVL Trees
For ideal searching in a binary search tree, the heights of the left and right
sub-trees of any node should be equal. But, due to random insertions and
deletions performed on a binary search tree, it often turns out to be far from
ideal. A close approximation to an ideal binary search tree is achievable if it
can be ensured that the difference between the heights of the left and the
right sub trees of any node in the tree is at most one. A binary search tree in
which the difference of heights of the right and left sub-trees of any node is
less than or equal to one is known as an AVL tree. AVL tree is also called as
Balanced Tree. The name "AVL Tree" is derived from the names of its inventors
who are Adelson-Veilskii and Landi. A node in an AVL tree have a new field to
store the "balance factor" of a node which denotes the difference of height
between the left and the right sub-trees of the tree rooted at that node. And it
can assume one of the
three possible values {-1,0,1}.
Data Structures
The following program demonstrates how to get input from the user in
graphics mode, echoed in the current colors and font size and font style.
#define ON 1
#define OFF 0
#include <graphics.h>
main( )
char nameString[80], ageString[80] ;
int age, gd = DETECT, gm ;
initgraph ( &gd, &gm, "c:\\tc\\bgi" ) ;
setbkcolor ( BLUE ) ;
setcolor ( YELLOW ) ;
settextstyle ( GOTHIC_FONT, HORIZ_DIR, 0 ) ;
moveto ( 0, 0 ) ;
outtext ( "Enter your name: " ) ;
getGrString ( nameString ) ;
moveto ( 0, gety( ) + textheight ( "A" ) ) ;
outtext ( "Name: " ) ;
outtext ( nameString ) ;
moveto ( 0, gety( ) + textheight ( "A" ) ) ;
outtext ( "Press key to exit! " ) ;
getch( ) ;
closegraph( ) ;
restorecrtmode( ) ;
getGrString ( char *inputString )
int stringIndex = 0, oldColor ;
char ch, outString[2] ;
/* xVal will store the screen position for each char */
int xVal[255] ;
outString[1] = 0 ;
xVal[0] = getx( ) ;
cursor ( ON ) ;
ch = getch( ) ;
cursor ( OFF ) ;
if ( ch == 0 ) /* avoid dealing with all special keys */
getch( ) ;
if ( ch == 8 ) /* backspace */
oldColor = getcolor( ) ;
--stringIndex ;
if ( stringIndex < 0 )
stringIndex = 0 ;
/* move to ( old horz position, current vert position ) */
moveto ( xVal[stringIndex], gety( ) ) ;
setcolor ( getbkcolor( ) ) ;
outString[0] = inputString[stringIndex] ;
outtext ( outString ) ;
moveto ( xVal [stringIndex], gety( ) ) ;
setcolor ( oldColor ) ;
inputString[stringIndex] = ch ;
outString[0] = ch ;
outtext ( outString ) ;
++stringIndex ;
xVal[stringIndex] = getx( ) ;
} while ( ch != 13 && ch != 10 ) ;
inputString[stringIndex] = 0 ;
cursor ( int on )
int curX, oldColor ;
/* we'll use an underscore as a cursor */
char uBarStr[2] = { '_', 0 } ;
if ( !on )
oldColor = getcolor( ) ;
setcolor ( getbkcolor( ) ) ;
/* save horizontal position before drawing cursor */
curX = getx( ) ;
outtext ( uBarStr ) ;
moveto ( curX, gety( ) ) ;
/* if we changed the color to erase cursor, change it back */
if ( !on )
setcolor ( oldColor ) ;
The function getGrString( ) echoes graphically the user input and stores it in a
buffer, and the function cursor( ) handles the cursor position.
System Utility
Ans: 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.
main( )
char *s ;
s = fun ( 128, 2 ) ;
printf ( "\n%s", s ) ;
fun ( unsigned int num, int base )
static char buff[33] ;
char *ptr ;
ptr = &buff [ sizeof ( buff ) - 1 ] ;
*ptr = '\0' ;
*--ptr = "0123456789abcdef"[ num % base ] ;
num /= base ;
} while ( num != 0 ) ;
return ptr ;
The above program would convert the number 128 to the base 2. You can
convert a number to a hexadecimal or octal form by passing the number and
the base, to the function fun( ).
Data Structures
Ans: As we know in a stack, the latest element is deleted and in a queue the
oldest element is deleted. It may be required to delete an element with the
highest priority in the given set of values and not only the oldest or the newest
one. A data structure that supports efficient insertions of a new element and
deletions of elements with the highest priority is known as priority queue.
There are two types of priority queues: an ascending priority queue is a
collection of items into which items can be inserted arbitrarily and from which
only the smallest item can be removed. A descending order priority queue is
similar but allows only the largest item to be deleted.
What is the difference between const char *p, char const *p, and char* const p
'const char *p' and 'char const *p' are the same, i.e. p points to a constant
character. On the other hand, 'char* const p' means p is a constant pointer
pointing to a character which means we cannot change the pointer p but we
can change the character which p is pointing to.
What's the difference between a null pointer, a NULL macro, the ASCII NUL
character and a null string?
Ans: A null pointer is a pointer which doesn't point anywhere. A NULL macro is
used to represent the null pointer in source code. It has a value 0 associated
with it. The ASCII NUL character has all its bits as 0 but doesn't have any
relationship with the null pointer. The null string is just another name for an
empty string "".
System Utility
Sparse Matrix...
A sparse matrix is one where most of its elements are zero. There is no precise
definition as to know whether a matrix is sparsed or not, but it is a concept
which we all can recognize intuitively. The natural method of representing
matrices in memory as two-dimensional arrays may not be suitable for sparse
matrices. That is one may save space by storing only those entries which may
be nonzero. If this is done, then the matrix may be thought of as an ordered
list of non-zero elements only. Information about a non-zero element has three
an integer representing its row,
an integer representing its column and
the data associated with this element.
That is, each element of a matrix is uniquely characterized by its row and
column position, say i, j. We might store that matrix as a list of 3-tuples of the
form (i, j, data), as shown below,
Although the non-zero elements may be stored in the array in any order,
keeping them ordered in some fashion may be advantageous for further
processing. Note that above array is arranged in increasing order of the row
number of non-zero elements. Moreover, for elements in the same row
number, the array is arranged in order of increasing column number.
What does the error "Null Pointer Assignment" mean and what causes this
Ans: 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
Data Structures
Ans: 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 ) .
Ans : 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 ) ) ;
How to extract the integer part and a fractional part of a floating point
Ans: 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 ) ;
For the value 5.150000 integer part = 5.000000 and fractional part =
94. How do I define a pointer to a function which returns a char pointer?
char * ( *p )( ) ;
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 ;
What's wrong with the following declaration: char* ptr1, ptr2 ; get errors
when I try to use ptr2 as a pointer.
Ans: 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 ;
Ans: 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.
Can we use scanf( ) function to scan a multiple words string through keyboard?
Ans: 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.
How to set the system date through a C program ?
Ans: 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 ) ;
Ans: 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 )
What is a heap ?
Ans: 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"
Ans: 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 %X\n",
getpid( ) ) ;
#include <stdio.h>
#include <stdarg.h>
void main( )
int i = 10 ;
float f = 2.5 ;
char *str = "Hello!" ;
vfpf ( "%d %f %s\n", i, f, str ) ;
vfpf ( "%s %s", str, "Hi!" ) ;
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.
Can we change the system date to some other date?
Ans: 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 ) ;
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.
Ans : 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 ( "%s\n", str1 ) ;
free ( str1 ) ;
Ans: 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 */
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'.
How to write a swap( ) function which swaps the values of the variables using
bitwise operators.


text:
Welcome to Shanghai C3MO Mining and Construction Machinery Co., Ltd.E-mail:[email protected]
Used and new Fixed crusher / shredder ... therefore it is just trivial that to handle such a complex scenario many machine tools are needed and used. Crushers are the kind of machine tool which are always present on the scene. There exist some different types of crusher (jaw crusher, turning crusher…
UsedCrushersLtd are the appointed dealers for Powercrusher, supplying a wide range of jaw, impact and cone crushers and screening equipment. We specialise in the sales of used Crushers,conveyors / feeders, stackers, screens and recycling equipment We are experienced in exporting worldwide, export quotes can be arranged.
Used used crusher mill for sale. Crushing machine for metals with tapes and with ferrous / non-ferrous separator. The machine is used to crush large quantities of …
Fortunately, here at BIG Machinery we carry an extensive collection of new and used crusher machines to satisfy your needs. New and used crushers for sale. Complete your refinement processing line by adding a stone/rock crusher or cone crusher as an addition to your SAG and ball mill(s).
Used conveying mining equipment and surplus crushing parts for sale on EquipmentMine. You have changed your edition to Global. Edition aware sections will now prioritize Global content.
Used Jaw Crushers and surplus parts for sale on EquipmentMine. You have changed your edition to Global. Edition aware sections will now prioritize Global content. Do not show this message again Close. Sign In; ... Used Crushing & Conveying Equipment for Sale.
Based on your preferences we search your desired crusher machine or equipment. We provide you a selection of possible machines along with our proposal. In case of a final agreement on your side, we buy the crusher for you. If you are interested in the offered crusher, we will do a technical check with the used machine.
Crushing Plant for sale & rental | Rock & Dirt. Search from 1000's of listings for new & used Crushing Plants for sale or rental updated daily from 100's of dealers & private sellers.
Misc. Construction Equipment . Condition New In Stock ... Crushers Screening Plants Conveyors Feeders Attachments Display Attachments {{ dataItem.ProductFamily }} {{ dataItem.ProductModel }} Back to Equipment Search. About Us; Locations; Contact Us ...
Shanghai XSM columbite processing machine Machinery Equipment Co., Ltd. is a R D, manufacturing, sales and after-sales service into a professional crusher manufacturing company, and it is a national building materials industry, high-tech enterprises.
Aggregate Equipment Guide is the best source for news, how-to's and equipment for the Aggregate Industry. We list equipment in all the major aggregate categories including conveyors, feeders, stackers, crushers, magnets, screening equipment, washing equipment, and more. Our website makes it easy to find the machines you need fast.
Browsing for used granite crusher machine for sale? The best online shopping experience is guaranteed! 1,073 used granite crusher machine products from 357 used granite crusher machine suppliers on Alibaba.com for sale are available!Talk with suppliers directly to customize your desired product and ask for the lowest price, good discount, and shipping fees.
For over 180 years, Stedman Machine Company has manufactured high-quality, professional grade impact crushers and effective rotor impact crushers for many applications and industries including aggregate, mining, and more. Our impact crushers are available in various sizes with feed, capacity, and horsepower options. Request your quote today!
Browse our inventory of new and used Crusher Aggregate Equipment For Sale at MachineryTrader.com. Top manufacturers include KINGLINK, , POWERSCREEN, CEDARAPIDS, WHITE LAI, , , KPI …
has earned its world-class reputation for innovative research, excellence in manufacturing, and quality products due to its philosophy of putting customers needs first. Our #1 goal is making the customer more productive and profitable by providing the best impactor-based technology and after-market support available.
A crusher is a machine designed to reduce large rocks into smaller rocks, gravel, or rock dust.. Crushers may be used to reduce the size, or change the form, of waste materials so they can be more easily disposed of or recycled, or to reduce the size of a solid mix of raw materials (as in rock ore), so that pieces of different composition can be differentiated.
Jaw crushers, Impact crushers, and Cone crushers for rock, concrete, stone, glass and more. Various used crushers plus NEW Beyer and Red Rhino models. GrinderCrusherScreen is your EXCLUSIVE North and South American Red Rhino dealer
's inventory of crushers include cone, gyratory, impact, jaw, portable crushing plants, and roll Crushers. Crushers are machines used to break and compress materials. If you are looking to sell your used crushers submit a request online or contact Erik Eichert at 630-238-7480.
Since 1996, OverBuilt has been manufacturing heavy machinery including car crushers and baler/loggers. Based in Huron, South Dakota, OverBuilt produces top-quality, high-performance equipment for auto salvage yards and scrap metal recyclers.
Machineryzone, classified ads for new and used construction equipment. Present in more than 20 countries, the Machineryzone site specialises in the sale and purchase of used and new public works, transport and handling equipment. 291,129 classified ads for public works equipment for sale on Machineryzone are currently online.
Crushers for Sale. View our entire inventory of New Or Used Equipment and even a few new, non-current models on EquipmentTrader.com.
Savona Equipment is a new and used iron ore crushing equipment supplier for large primary ore crushing, secondary, and tertiary fine material as well as crushing equipment for aggregate production. We have crusher parts for sale but they are subject to availability. We sell rock crushing equipment as part of our new and used aggregate equipment packages as well as to mining operations that ...
An impact crusher allows you to force two surfaces towards one another, crushing the material caught between them. There are three different types of primary impact crushers to pick from; horizontal shaft impactors, cage mill pulverisers and vertical shaft impactors, all of which you'll find here at Omnia Machinery.
Game, used glass crusher w/conveyors & trommel, 2 conveyors have magnetic head pulleys, 5 HP crusher motor 208/230/460 V. Alan Ross Machinery Corp, Northbrook, IL 847-480-8900 (Email: [email protected] ) Rustin Ross
Home Machines/Equipment Our Used Equipment Inventory Crushers. Crushers. Our inventory of used crushers gives you a great opportunity to buy with confidence, and, save some money, too. And since we take trades, this may well be the perfect place to shop for a used crusher.
Nov 22, 2013· Special Weaves Product. Car engine&reducer shredder with hydraulic system/Car Engine Shredder/Scrap Car Shredding Machine - Duration: 6:07. james zhai 1,521,587 views
Aggregate Equipment for sale & rental | Rock & Dirt. Search from 1000's of listings for new & used Aggregate Equipment for sale or rental updated daily from 100's of dealers & private sellers.
Browse our inventory of new and used Crusher Aggregate Equipment For Sale at MachineryTrader.com.
Our used crushing equipment is ideal for a number of industries including mining, milling, gravel and sand, fertilizer, chemical, recycling and many other processing projects. When choosing used crushing equipment select a crusher that can crush mining material and media to the correct particle size.
Used Finlay J-1170HR Track Jaw Crusher Used IRock RDS-20 Portable Impact Crusher Used Eagle 1200 Portable Impact Crusher Used Eagle 1400 Portable Impact Crusher ... Used Equipment Purchasing. About. Equipment For Sale. Crushers Screens Washing Equipment Conveyors Bins, Hoppers & Feeders Pugmills Asphalt Equipment

subset: commoncrawl


text:
Bedroom Amazing Minimalist Bedroom At Night Photo Inspirations Vector Cartoon Illustration Of Cozy Bedroom At Night Modern Interior Living Room With Double Nightstand Lamp Dresser Armchair Average Electric Bill In Apartment Lilac Twinkle Lights For
To have a general idea of the way the bedroom will appear, color a small part of the wall employing any particular color. Ascertain the size of the bedroom and discover out whether you should make it appear larger. When it has to do with coloring bedrooms, personal taste is easily the most important issue. Actually, your small bedroom could be a blessing for a far better nights sleep. When you get a little bedroom, you have to make the the majority of the room to make it appear more spacious.
If you think your bedroom is pretty small spaced and you're trying to find some suggestions to acquire maximum storage option via your bed. It might be ideal for your bedroom. Everything you have to transform your bedroom is contained in this set. You can also select readymade bedroom sets to make your job a bit easier.
master bedroom sizeegyptian bedroom themeboys bedroom furnitureceiling fans for bedrooms4 bedrooms apartmentssafari bedroom ideas for adultsideas for a bedroomcolors for girl bedroombedroom makeup vanitiesasian bedroom setsthree bedroom houses for rent near megirls turquoise bedroom ideasshabby chic bedroom furniturebedroom bed setsbedrooms unlimited
Most sets now return within the King sizes, because of the developing demand for bigger areas in homes. When you get full sets of daybed bedding from this retailer they'll wave all delivery expenses, making them a good choice to spend less on bedding. If you are searching for good excellent bedding sets in any size, it is better to go with the greater thread count versions.
Platform beds are now ever more popular in bedroom interior design. If you're planning to create the platform bed all on your own, you will need to understand that it's not a 1 man's job. If you purchase everything together, many contemporary bedroom sets now have a platform bed instead of a few of the older or timeless popular styles. Platform beds are the newest in bed design nowadays.
The furniture should be chosen with extreme care, as comfort and fashion, both will need to be an integral quality of the furniture that you've chosen. The manner in which you place your furniture also has an important function in making your residential space appear beautiful and refined. Even though you should select furniture that's proportional to the measurements of the attic, yet a statement furniture piece is critical to create a focus within the room. Furniture may also be created with some denim fabric. That means you should get a furniture set based on the needs of persons. If you would like to obtain a bedroom furniture for a teenager, then the furniture needs to be designed to coincide with his demands. The reason many individuals appear to go for modern and contemporary bedroom furniture is this sort of furnishing, besides looking good and being easy to keep, is usually more in sync with the present life-style.


text:
at 462 Colombo Street, Sydenham Quarter, Christchurch , 8023
Jewellery - Watches - Clocks - Repairs - Custom Jewellery Design Pinterest - Kennett Crafted Jewels Instagram - KennettJewels Twitter - KennettJewels
The new Kennett Crafted Jewels is now open at 462 Colombo Street. Located in the new Sydenham Quarter. In opening the new store we have taken the opportunity to stock a range of New Zealand jewellery and international watch brands. -Jewellery- Kennett Diamonds Lisa Hoskin Boh Runga Clara Jewellery Jo Luping SteamPunk & Vintage Clay - By Rainey Designs -Watches- Tissot Obaku Ice watch Boccia Karlsson Clocks
560 FB users likes Kennett Crafted Jewels, set it to 36 position in Likes Rating for Christchurch, New Zealand in Shopping/retail category


text:
This morning one of my yoga clients (also a Librarian) told me she was having a hard time suggested middle grade novels to her home-schooled niece; she didn't want to accidentally teach her about crappy things that happen in school (essentially giving her books that would teach conflict). I've been hearing this a lot more since my posts about conflict building plot lines and books teaching negative behavior. So as promised here are a few titles that don't avoid conflict but also spend just as much time in resolution:
Board Books:
Vegetables in Underwear by Jared Chapman
Woke Baby by Mahogany L. Browne
Hats of Faith by Medeia Cohan
Feminist Baby by Loryn Brantz
Picture Books:
Mae Among the Stars by Roda Ahmed
The Book of Mistakes by Corinna Luyken
After the Fall by Dan Santat
I'm worried by Ian Black
Be Kind by Pat Zietlow Miller
Middle Grade Novels:
The Remarkable Sunrise of Coyote Sunrise by Dan Gemeinhart
Armstrong and Charlie by Steven B. Frank
Max Tilt Series by Peter Lerangis
The Misfits by James Howe
Super Max by Susan Vaught
Posted by John David Anderson


text:
DELAWARE — Martha "Jane" Ludwig, age 90, passed away Tuesday, July 2, 2019 at Willow Brook Christian Village. She was born May 1, 1929 in Woodsfield, Ohio to the late William and Garnet (Swartzlander) Ludwig.
She was preceded in death by her sisters Doris Jeffers and Loretta "Toots" Mann, and brothers Irvin Ludwig and Bill Ludwig. Jane is survived by her sister-in-law, Ida Belle Ludwig; nieces, Carolyn (Don) Kniesly, Susan (Barry) Orahood and Janet (Tim) Archer; and nephews, Stan (Nina) Ludwig, Dean (Jackie) Ludwig and Neal (Susie) Mann.
Jane was a 1948 graduate of Woodsfield High School. She worked for the State of Ohio Bureau of Employment Services for 39 years and retired in 1987.
Jane loved spending time with her family and going to Florida to visit her brother and sister-in-law. She enjoyed several trips and cruises with her friend, Shirley Cochran. Jane loved being outdoors and played several sports, including golf and bowling. She played fast pitch softball with her sister, "Toots," for the Shepherd Athletic Club in Columbus. Jane was an avid OSU Buckeyes fan. She moved to Willow Brook Christian Village in 2013, and appreciated the excellent care that she received from the staff at Willow Brook and from Heartland Hospice.
Her family will receive friends from 11 a.m. to noon on Wednesday, July 10, 2019 followed by a memorial service at noon at Schoedinger Worthington Chapel, 6699 North High Street, Worthington, OH 43085. Burial will be at 11 a.m. on Thursday, July 11, 2019 at Oak Lawn Cemetery in Woodsfield, OH.
Memorial contributions may be made to "Passages" at Willow Brook Christian Village, 100 Willow Brook Way South, Delaware, OH 43015 or to Heartland Hospice, 685 Delaware Avenue/Suite 300, Marion, OH 43302.
The My Memorials Facebook app allows you to:
© 2019 Legacy.com. All rights reserved.


text:
Visit NBCNews.com for breaking news, world news, and news about the economy
The CDC says it's concerned about kids all suffering from polio-like symptoms, with no clear identification of their illness.
Categories: Elementary School // Health & Wellness // Pediatrician
Researchers found that 18-year-olds who were teased or bullied by a sibling were twice as likely as their peers to report depression or attempt self-harm.
The experts at Children's Health Fund compiled a list of crucial questions every parent should ask about their child's health.
© Copyright


text:
Complete and functional website designed for Spa businesses, hotels, hostels, pensions, hostels and campsites.
Add to wishlist
Website for your Spa, is a complete website that is ready to only have to change the content and go. It is a multi-device web page, it adapts perfectly to PC, tablet and mobile monitors. This responsive web allows you to create pages of content, post entries and has a very complete editor with many elements for you to add and / or modify your web page.


text:
Mon, Aug 19, 2019 | Updated 03.05PM IST
LAST UPDATED : Apr 24, 2019, 03:59 PM IST
The performance at Karthika Thirunnal Theatre was also attended by veteran actor Nedumudi Venu.
Radhika Kumaraswamy who is busy with two women-oriented movies - 'Bhairava Devi' and 'Damayanthi', has completed work on the latter.
Nalacharitham, the famous Kathakali play staged at the Theerthapadamandapam recently turned to be a crowd puller in the city with the participation of experienced actors.
The actress will soon be seen in a lead role in Sri Vishnu's upcoming film Nala Damayanthi
Geethu Mohandas has said that she is not teaming up with any of her close friends for a movie
Nikitha Narayan has her hands full
This is the second such incident in the city in recent times. A week ago, a one-and-a-half-year-old child drowned in a pit dug to construct a lift outside their house in Villivakkam.


text:
Treat locks to a makeover with am expert master haircut; opt to add permanent colour or half-head foils for a more dramatic change
Recent Positive Reviews
All reviews are from people who have redeemed deals with this merchant.
What You'll Get
The Deal
$69 for an expert master haircut (total value up to $110)
$149 for an expert master haircut with a bespoke permanent or semi-gloss colour (total value up to $270)
$159 for an expert master haircut with a half head of foils or balayage (total value up to $310)
- Enjoy a fresh new look with an expert master haircut - includes consultation, relaxing scalp massage, wash, haircut, & blow-dry finish
- Opt to include permanent or semi-gloss colour, or go for a half head of foils or a balayage treatment
- Sip on a complimentary glass of sparkling wine
- Consultation included
- Central Sydney location
The Fine Print
• Limit of 1 voucher per person
• Purchase up to 5 additional as gifts
• New customers only
• Entire value must be used in one visit; all services must be used by the same customer
• All bookings require a consultation between the client and hair stylist at the commencement of the service
• Late arrival may shorten session time
• Bookings are essential and subject to availability
• Requests for specific hairdressers may incur an additional fee, and are subject to availability
• Bookings during the month of December will incur a $40 surcharge
• Each offer includes a complimentary glass of sparkling wine; must be 18 years or over to consume alcohol
• Extra long hair (past the bra strap) or thick hair may incur a surcharge of $25, payable directly to merchant
• Additional surcharge applies for Sat, Sun and late night appointments; please confirm with SoHo On Crown
• $40 surcharge applies for tone, payable directly to SoHo On Crown
• If permanent or semi-permanent colour is required on top of the included balayage highlights, this will incur an extra fee
• Balayage or half-head of foils can be upgraded to full-head foils for a surcharge
• Colour correction not included; this requires a separate consultation and will incur a surcharge
• Standard fine print for all deals
How to Redeem
• Expiry: 90 days from purchase
• Phone to book: (02) 9360 9534
• Must state Voucher and Security Code at time of booking
• Present printed or smartphone voucher on arrival
• Download free Groupon app for Android and iOS
About SoHo On Crown
Run by style advisor Glen Fitzgerald and master stylist Leo Pimpa, SoHo On Crown is a hair and beauty salon whose decor is designed to bring to mind New York's artistic SoHo district. Treatments on offer include keratin hair straightening, men's cuts, blow-dries, facials, eyebrow shaping, waxing and mani-pedis. Hair accessories, styling products, jewellery, homewares and fragrances are also available. SoHo On Crown is nestled in Surry Hills.


text:
Calico Critters Triple Baby Bunk Beds Only $6.15!
If your kids love Calico Critters and need new beds for their toys, the Calico Critters Triple Baby Bunk Beds is just what they need. Right now, this is on sale for $6.15!
- Complete with 3 mattresses, 3 pillows, 3 blankets and 2 climbing ladders
- Designed to furnish the Calico Critters Homes (sold separately)
- All furniture is 1:24 scale and is proportional
- Calico Calico Critters sold separately
- Mix and match with other Calico Critters play sets to create a whole Calico Critters village!
Shipping will be free with Amazon Prime or an order of $25 or more in qualified items. Don't have Amazon Prime? Get a free 30-day trial!
Check out all of the other AMAZON deals while you're on Become a Coupon Queen.
**Price(s) listed above are accurate at the time of posting and subject to change.


text:
No such thing as best.
All about what suits you.
Rather go hormonal or fe. condom?
Not all hormonal ones are the same either.
Pills, creams, patches, sponges, diaphragm, rings, Intrauterine devices…
So think about the best option for you, talk with your doctor. Sometimes you need to try out a couple before you find the one you like best.posted about 8 years ago
I have a IUD and I don't think I'll ever go back. although I only got to this because everything else just wasn't right for me. It's all about trying out the best thing for you.posted about 8 years ago
IUD's are usually the choice for women who already have had children.
They require a certain physique?
And there are a few different ones in this category as well. Also they need a doctor to insert and remove it. Other than that, I hear they are quite a care-free option for those it suits!posted about 8 years ago
abstinence is always the best choice, but foregoing that there are many options depending on what suits you best (Nuva ring, Pills, IUD, etc), but whatever you may choose make sure you are using it correctly and continue to use condoms! Otherwise there is always the possibility of getting pregnant or getting an std.posted about 8 years ago
newer versions have higher risk – http://www.npr.org/2011/06/01/136864370/fda-issues-warning-about-some-birth-control-pills
older ones have lower risk, but the risks are the same.
condoms or no sex seems like the best deal. taking risks with one health is too much. i rather have a kid when i am not ready for one than a stroke.posted about 8 years ago
I get depo provera shots. I like them because I only have to get one every 12 weeks and I have about 4 periods a year. I also use condoms.posted about 8 years ago
IUDs are pretty good.
Having given birth vaginally is not at all a requirement. Doctors aren't willing to do it on someone who hasn't is because their cervical opening is tighter/smaller, but in the UK you can get one even without ever having had children.
The only anatomical problem I could think of is if you had a uterine septum or something like that.posted about 8 years ago


text:
Jonny cordially welcomes you to begin the process of a wonderful on line on line casino journey. We could some brand-new gambling house, presented with 2018 and centric simply by some of the dependable computer software issuers during the via the internet wagering industry. You're searching for just about the most fantastic video games and even possibilities that will secure substantial, you are going to take pleasure in being hassle-free Jonny Jackpot Casino. Sign on now and then Jonny will probably help you get begun with as many as £1,000 together with 100 incentive spins to help experience typically the legendary Starburst slot machine game through NetEnt. Pretty much all you should do will be first deposit at the very least £10 and even we shall tie in with any put 100% as much £1,000 together with credit scores your own account with 100 bonus spins.
Typically the rewards won't stop there. Jonny has got many different deals away from home planning to register a supplementary elevate in excitement by means of cash rebates, money go with gives and even more spins. Continue to keep enjoying themselves with some of our on-line internet casino whenever you work your way upward a lot of our VIP programme values fo you to look ahead to customized returns as a means regarding thanking people designed for having fun with found at Jonny Jackpot.
Types of Game Selection
Regardless of whether you like re-writing your slot reels or maybe you may much rather the wager with these dining room table and even live life car dealer game, we've found everthing, such as entertaining scratch business cards that might just be an immediate cash one who did that!
Jonny happily shows you will utilizing many hundreds of immersive, enjoyable slot machine game online games via the most beneficial software program suppliers over the market. We've found more information on different lets go of that him and i help to increase constantly, which means that have a Lets Play great time using titles want Booklet in Clicking, Kingdom involved with Greeting cards, Irish Riches and plenty of others. You will also uncover a good amount of famous game titles of our own lobby.
Jonny provides ensured that many a much-loved game titles are actually all set and looking ahead to everyone, consisting of Starburst, Brilliant Dough, Stagger Scag plus Gonzo's Quest. A kit for making look for well-liked titles such as Elven Miracle, Gemtastic, Just about all Aces Online poker, Gunslinger, Wild Rex and several more. Whether it's holistic jackpots and also considerable wins you're once, Jonny seems to have a superb decision for you within involving our 1,000s connected with video poker machines titles. Obtain a spin on the subject of enormous position jackpots enjoy Irish View, Mars Problems, Ultra Lots of money and Pans for Chances plus unquestionably stay enough time to bring home the particular bacon. Savor the epic casino experience of each of our platform video games spot, just where you can find numerous remarkable online games prefer poker, chemin de fer, roulette and then blackjack besides a lot of variants for each. If perhaps cards happen to be any thing, we now have from Chemin de fer Pro to help Betting house Hold'Em, Jacks or More suitable, The state of texas Flip in addition to lots in similar awesome choices.
Jonny would love you actually undertake a truly awesome time during his online casino. That is why he has included any different options of reside supplier online games to obtain each of the thrills of a land-based casino without needing to get away from home. On account of Development Game playing, you are able to absorb oneself within a real-life gambling knowledge, detailed with authority croupiers and a preference somewhere between much of our conventional dealership casino and / or themed casino. Our reside game feature chemin de fer, roulette and additionally blackjack. There is certainly additionally Golf Facility, Are located Hold'Em, VIP Roulette, Super Roulette and Ideal Catcher to endeavor a person's site web beginners luck on.
Amongst all the steps, be positive to possess a carry on a scuff cards. They brandish an amazing technique to strike the application grateful during Jonny Jackpot Casino. If perhaps you want to take the arresting Jonny Jackpot exposure to people where you are going, you possibly can! Some of our internet casino has got apps designed for Android not to mention iOS items in order to carry on with content spinning that video slot machine fly fishing reels or possibly having a shot within the tables you reside you are. Your apps are generally liberal to download, plus much of our video game titles are equally since immersive during gameplay not to mention level of quality as soon as you use a transportable device.