Skip to main content

Featured

Python To read the news

Hello Guys, in this blog we will use Python to read the news. Before this, the concepts of APIs, JSON, Python Libraries should be clear. We are going to use 'newsdataapi' library of Python. The newsdataapi is the official Python client library for the Newsdata.io API. Its primary purpose is to simplify the process of accessing global news data directly from Newsdata.io, allowing developers to integrate news content into their applications without having to manually construct HTTP requests. It acts as a wrapper around the API, handling the complexities of authentication, request parameters, and response parsing. So Lets Start. Making Python to read the online news Step 1: Get your API key Sign Up : Go to the Newsdata.io website and create a free account. The free plan typically offers a limited number of credits per day (e.g., 200 credits). Get the Key : Once you've created and verified your account, your unique API key will be available on your dashboard. Copy this key,...

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