Skip to main content

Featured

Tic Tac Toe

Tic Tac Toe Tic Tac Toe is a simple, two-player strategy game played on a 3x3 grid. Players take turns marking a square with either an "X" or an "O", with the goal of being the first to align three of their marks in a row, column, or diagonal.  I have made a simple Tic Tac Toe game using html, css, javascript.  The game doesnot have much features. The game is created to be played by two peoples. It is just a simple game. The code of this game you get in my github page   Link of this game code is below: Tic Tac Toe Game Code /

Conio.h functions in C language

Introduction 

Whenever we write a program in c language we include conio.h and stdio.h  as this two header files are necessary to make a simple program. The conio in 'conio.h' standards for Console Input Output. It is a non-standard header file used in C and C++. We should use turbo C/C++ to compile and execute conio.h header file function. Here are some common functions that are mostly used.

clrscr()

This function is used to clear the screen. Whenever we want to clear the printed things in screen we use this function.

getch()

This function is used to hold the output screen. If you don't used this function then the output screen will close in fractions of second.

putch()

The function is used to print only single character. For example: 

int main()
{
char a = 'a';
putch(a);
return 0;
}

cprintf()

cprintf() function is used to print output value in the console or output screen as per the format. Here's the way to use it.

int main(void)
{
    char string[50];
    cprintf(“type string value: ”);
    cscanf(“%s”,string);
    cprintf(“typed string value is: %s”, string);
    return 0;
}


cscanf()

This function is used to read input from the output screen or console.  A format specifier is passed to cscanf() function to read input in the required format. Here's the way how we can use it.

int main(void)
{
    char string[50];
    cprintf(“type string value: ”);
    cscanf(“%s”,string);
    cprintf(“typed string value is: %s”, string);
    return 0;
}

textcolor()

textcolor() function is used to change the color or the text. Colors name which can be used are: BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN, LIGHTGRAY, DARKGRAY, LIGHTBLUE, LIGHTGREEN, LIGHTCYAN, LIGHTRED, LIGHTMAGENTA, YELLOW, WHITE.

Example

int main(void)
{
    clrscr();
    textcolor(GREEN)   
    
    cprintf("This text is in blue color");
    return 0;
}





Comments

Popular Posts