> August 2011 ~ Online tutorial

ARRAY

ARRAY Array Introduction Use of Array Initializing Arrays Arrays as parameter Arrays as pointer ...

conditional statement If Condition Else-If Condition Switch Statement Goto...

Loop statement in c

Loop statement While Loops For Loops Do While Loops...

Operator in c

Operator Comparison and Logic operator Arthimetic operator Operator Precedence cast Operator Special operator...

Directive in c

Directive #ifndef #ifdef #if #include #line #error #define ...

MATH.H

math.h math.h sizeof() abort() fmod() modf() atoi() sqrt() scanf pow() log() atan() asin() atan...

STDIO.H

Stdio.h clearerr() fdopen() fflush() ferror() rewind() putchar() getchar() feof() putw() getw() fseek() ...

ALLOC.H

alloc.h realloc() farralloc() farcoreleft() coreleft() farmalloc() brk() sbrk() malloc() calloc() ...

CONIO.H

conio.h ungetch() wherex() gettextinfo() gettext() getche() getpass() cputs() delline() clrscr() getch() clreol() cgets()...

DOS.H

dos.h bdos() delay() disable() enable() freemem() getdta() freemem() absread() keep() getdate() setdate() sound() getverify() unixtodos() ...

unixtodos() in c

 unixtodos()  Converts date and time from UNIX to DOS format  Declaration:    void unixtodos(long time, struct date *d, struct time *t);  Remarks: unixtodos converts the UNIX-format time given in time to DOS format and fills in the date and time structures *d and *t.  Return Value: None  Example:  #include...

getverify() in c and setverify() in c

getverify() , setverify() getverify gets the verify state setverify sets the verify state Declaration: int getverify(void); void setverify(int value); Remarks: getverify gets the current state of the verify flag. setverify sets the current state of the verify flag to value. The verify flag controls output to the disk.When it is off, writes are not...

sound() in c

sound(),nosound() sound turns the PC speaker on at the specified frequency nosound turns the PC speaker off Declaration: void sound(unsigned frequency); void nosound(void); Remarks: sound turns on the PC's speaker at a given frequency. nosound turns the speaker off after it has been turned on by a call to sound. frequency specifies the frequency of...

setdate() in c

setdate() Gets or sets DOS system date Declaration: void setdate(struct date *datep); Remarks: setdate sets the system date to the date in *datep. Return Value: getdate: None On success, returns 0 Otherwise, returns a non-zero value and sets errno to EINVAL (Invalid date) Program #include <stdio.h> #include <process.h> #include <dos.h> int...

getdate() in c

getdate() Gets or sets DOS system date Declaration: void getdate(struct date *datep); Remarks: getdate fills in the date structure *datep with the system's current date. Return Value: getdate: None On success, returns 0 Otherwise, returns a non-zero value and sets errno to EINVAL (Invalid date) Program #include <stdio.h> #include<dos.h> int...

poke() and pokeb() in c

poke(),pokeb() poke stores an integer value at the memory location segment:offset pokeb stores a byte value at the memory location segment:offset Declaration: void poke(unsigned segment, unsigned offset, int value); void pokeb(unsigned segment, unsigned offset, char value); Remarks: poke stores the integer value at the memory location segment:offset. pokeb...

keep() in c

keep() Exits and remains resident Declaration: void keep(unsigned char status, unsigned size); Remarks: Both _dos_keep and keep use DOS function 0x31 to return to DOS with the exit status in status. The current program remains resident. These functions set the program to size paragraphs in length, and free the remainder of the memory of the program. You...

FOR LOOP USING C

**FOR LOOP** ============ #include<studio.h> #include<conio.h> void main() { int i; clrscr(); for(i=1; i<100; i+1) { printf("WELCOME"); } getch(); ...

WHILE LOOP PROGRAMMING USING C

**WHILE LOOP PROGRAME** ======================= #include<studio.h> #include<conio.h> void main() { int a,b=0,c; clrscr(); printf("\n a= "); scanf("%d",&a); while(a>0) { c=a%10; printf("\n %d%d", c,b); b=b*10+c; a=a/10; printf("%d",a); getch(); } printf("%d",b); getch(); ...

REVERSE NUMBER PROGRAMMING USING C

**REVERSE NUMBER PROGRAME** =========================== #include<studio.h> #include<conio.h> void main() { int a,b,c,s=0; clrscr(); printf("\n a= "); scanf("%d",&a); while(a>0) { a-c=a%10; printf("%d",c); s=(s*10)+c; a=a/10; } getch(); ...

SET DATE PROGRAMMING USING C

**SET DATE PROGRAME** ===================== #include<studio.h> #include<conio.h> #include<process.h> #include<dos.h> void main() { struct date reset; reset.da-year=2008; reset.da-day=17; reset.da=mon=6; settime(&reset); return 0; ...

SET TIME USING C PROGRAM

**SET TIME PROGRAME** ===================== #include<studio.h> #include<conio.h> void main() { struct time t; t.ti-hour=11; t.ti-min=0; settime(&t); ...

switch programs using c

**switch programs** =================== #include<stdio.h> #include<conio.h> void main() { int a=100; clrscr(); printf("\n mark1= "); scanf("%d",&a); switch(a/10) { case 0: printf(" d class"); break; case 1: case 2: case 3: printf("c class"); break; case 4: case 5: printf(" b class"); break; ...

NESTED IF PROGRAMMING EXAMPLE

**NESTED PROGRAME** =================== Nested If statement means to use the if statement inside the other if statement. Here we are providing you an example using Nested-If statement Program: #include<studio.h> #include<conio.h> void main() { int x,y,z,max; clrscr(); printf("\n x= "); scanf("%d", &x); printf("\n y= "); scanf("%d",...

IF AND ELSE PROGRAMMING EXAMPLE

**IF & ELSE PROGRAME** ===================== #include<studio.h> #include<conio.h> void main() { int x,y,max; clrscr(); printf("\n mark1= "); scanf("%d", &x); printf("\n mark2= "); scanf("%d", &y); if(x>35 && y>35); { printf("PASS"); ] else { printf("FAIL"); } getch() ...

DIVISIBLE NUMBERS USING C

**DIVISIBLE NUMBERS** ===================== #include<studio.h> #include<conio.h> void main() { int a; clrscr(); printf("\n a="); scanf("%d",&a); if(a%7==0) { printf("\n The Number is Divisible by 7"); } else { printf("\n The Number is not Divisible by 7"); } getch(); ...

ODD OR EVEN NUMBERS USING C

**ODD OR EVEN NUMBERS** ======================= #include<studio.h> #include<conio.h> void main() { int a; clrscr(); printf("\n a="); scanf("%d",&a); if(a%2=0) { printf("\n Even Numbers"); } else { printf("\n Odd Numbers"); } getch(); ...

BETWEEN NUMBERS USING C

**BETWEEN NUMBERS** ==================== #include<studio.h> #include<conio.h> void main() { int a; clrscr(); printf("\n a= "); scanf("%d", &a); if (a==1) { printf("\n one"); } elseif(a==2) { printf("\n two"); } elseif(a==3) { printf("\n three"); } elseif(a==4) } printf("\n four"); } ...

circle radius using c

#include<stdio.h> #include<conio.h> void main() { float a,r; printf("\n Enter the Radious:"); scanf("%f", &r); a=pi*r*r; printf("\n area of the cicrle is %f", a); getch(0; } Enter the radius :4 area of circle:50.12...

add two no using c

** ADD TWO NO's** ================= #include<stdio.h> #include<conio.h> void main() { int a,b,c; clrscr(); printf("\n ENTER THE tWO nUMBERS:"); scanf("%d%d", &a,&b); c-a<b; printf("\n a,b = %d", c); getch(); } enter the two number : 10 20 c=30 ...

getdta() in c

getdta() gets disk-transfer address Declaration: char far *getdta(void); Remarks: getdta returns the current setting of the disk transfer address (DTA). Return Value: getdta returns a far pointer to the current DTA Program #include <dos.h> #include <stdio.h> int main(void) {    char far *dta;    dta = getdta();  ...

_dos_freemem() in c

_dos_freemem() Frees a previously allocated DOS memory block Declaration: unsigned _dos_freemem(unsigned segx); Remarks: _dos_freemem frees a memory block allocated by a previous call to _dos_allocmem. segx is the segment address of the block. Return Value: On success, both functions return 0 On error,_dos_freemem returns the DOS error code and sets...

freemem() in c

Frees a previously allocated DOS memory block Declaration: int freemem(unsigned segx); Remarks: freemem frees a memory block allocated by a previous call to allocmem. segx is the segment address of the block. Return Value: On success, both functions return 0 On error, _dos_freemem returns the DOS error code and sets errno to ENOMEM (Bad memory...

enable

   Macros that disable and enable interrupts  Declaration:     void enable(void);    void _enable(void);  Remarks: These macros provide programmers with flexible hardware interrupt control.    enable and _enable enable interrupts,     allowing any device interrupts to occur. Only...

disable

 Macros that disable and enable interrupts  Declaration:    void disable(void);    void _disable(void);  Remarks: These macros provide programmers with flexible hardware interrupt control.   disable and _disable disable interrupts.     allowing any device interrupts to occur. Only the NMI (non-maskable...

delay

 Suspends execution for interval (milliseconds)  Declaration:   void delay(unsigned milliseconds);  Remarks: With a call to delay, the current program is suspended from execution for the time specified by the argument milliseconds. It is not necessary to make a calibration call to delay before using it. delay is accurate...

bdos

 Accesses DOS system calls  Declaration:  int bdos(int dosfun, unsigned dosdx, unsigned dosal);  Remarks: bdos provides direct access to many of the DOS system calls. See your DOS reference manuals for details on each system call.  Use bdos for system calls that require an integer argument.  Use bdosptr if system...

allocmem

 Allocates DOS memory segment  Declaration:    int allocmem(unsigned size, unsigned *segp);  Remarks: allocmem and _dos_allocmem use the DOS system call 0x48 to allocate a block of free memory and return the segment address of the allocated block. If not enough room is available,   allocmem makes no assignment...

absread in c

 <a href="http://gan.doubleclick.net/gan_click?lid=41000000035692252&pubid=21000000000397534">Absread</a> reads absolute disk sectors  Declaration:    int absread(int drive, int nsects, long lsect, void *buffer);  Remarks:   absread uses DOS interrupt 0x25 to read specific disk sectors. Both functions...

ungetch

 Pushes a character back to the keyboard  Declaration: int ungetch(int ch);  Remarks: ungetch pushes the character ch back to the console, causing ch to be the next character read. ungetch fails if it is called more than once before the next read.  Return Value:    On success, returns the character ch.    On...

wherex, wherey

<a href="http://gan.doubleclick.net/gan_click?lid=41000000035692252&pubid=21000000000397534">wherex</a> gives current horizontal cursor position    wherey gives current vertical cursor position  Declaration:    int wherex(void);    int wherey(void);  Remarks:  wherex returns the x-coordinate...

gettextinfo

 Gets text-mode video information  Declaration:  void gettextinfo(struct text_info *r);  Remarks: gettextinfo fills in a structure with the current text video information.  Return Value: gettextinfo does not return. The results are returned in the structure *r.  Example:  #include <conio.h>  int...

getche

  getche gets a character from console, and echoes to the screen  Declaration:    int getche(void);  Remarks: getche reads a single character from the keyboard and echoes it to the current text window, using direct video or BIOS.  Return Value: Both functions return the character read from the keyboard. program #include...

gettext

   gettext copies text from text-mode screen to memory   Declaration:    int gettext(int left, int top, int right, int bottom, void*destin);  Remarks:  gettext stores the contents of an onscreen text rectangle defined by (left, top) and (right, bottom) into the area of memory *destin. gettext reads the...

getpass

 Reads a password  Declaration:  char *getpass(const char *prompt);  Remarks: getpass reads a password from the system console, after prompting with the null-terminated string prompt and disabling the echo. It returns a pointer to a null-terminated string of up to eight characters (not counting the null terminator).  Return...

cputs

Writes a string to the text window on the screen  Declaration:   int <a href="http://gan.doubleclick.net/gan_click?lid=41000000035692252&pubid=21000000000397534">cputs</a>(const char *str);  Remarks: cputs writes the null-terminated string str to the current text window. It does not append a newline character. The...

getch

 getch gets a character from console but does not echo to the screen  Declaration:    int getch(void);    Remarks: getch reads a single character directly from the keyboard, without echoing to the screen.  Return Value: Both functions return the character read from the keyboard. Progarm #include <conio.h> #include...

delline

 (Text mode): Deletes line in text window  Declaration:  void delline(void);  Remarks: delline deletes the line containing the cursor and moves all lines below it one line up. delline operates within the currently active text window.  Return Value:  None  Example:  #include <conio.h>  int...

clrscr

 Clears text mode window  Declaration: void clrscr(void);  Remarks: clrscr clears the current text window and places the cursor in the upper left-hand corner (at position 1,1).  Return Value:  None  Example:  #include <conio.h>  int main(void)  {     int i;     clrscr();  ...

clreol

 Clears to end of line in text window  Declaration: void <a href="http://gan.doubleclick.net/gan_click?lid=41000000035692252&pubid=21000000000397534">clreol</a>(void);  Remarks: clreol clears all characters from the cursor position to the end of the line within the current text window, without moving the cursor.  Return...

cgets

 Reads string from console  Declaration: char *cgets(char *str);  Remarks: cgets reads a string of characters from the console and stores the string (and the string length) in the location *str. Before you call cgets, set str[0] to the maximum length of the string to be read. cgets reads characters until it encounters a carriage-return/linefeed combination...