Aditya Chatterjee's Blog, page 61
January 1, 2023
Find multiplication table of 2 numbers
In this article, we have explained how to find the multiplication table of 2 numbers using functions and implement the technique in C Programming Language.
Table of contentsProblem statementApproach to solveImplementationOutputProblem statementIn this problem, we have to find the multiplication table of 2 numbers using functions. Given a number N, we have to print the multiplication table till 10 that is:
N x 1 = ...
N x 2 = ...
...
N x 10 = ...
For example, if N = 5, then the multiplica...
December 31, 2022
Return two digit after decimal point in C
In this article, we have explained how to return two digits after decimal point using functions and implemented the technique in C Programming Language.
Table of contentsProblem statementApproach to solveImplementationOutputProblem statementIn this problem, we have to return two digits ater decimal point using functions.
For example, if the input number is 5412.921445, then the first two digits after decimal point are 92.
Approach to solveFollowing is the approach to solve the problem:
...Return last two digits of an Integer in C
In this article, we have explained how to return last two digits of an Integer using functions and implemented the technique in C Programming Language.
Table of contentsProblem statementApproach to solveImplementationOutputProblem statementIn this problem, we have to return last two digits of a number using functions.
For example, if input is 139245, then the last two digits (that is two least significant digits) are 45.
Approach to solveFollowing is the approach to solve this problem:
...December 30, 2022
Print the triangular pattern (right angle triangle) in C
In this article, we have take a look at how to print a triangular pattern (right angle triangle) with integers 1 to 15 in C Programming Language.
Following is the pattern:
1 2 3 4 5 67 8 9 1011 12 131415Table of contentsProblem statementApproach to solveImplementationOutputProblem statementIn this problem, we have to print the following triangular pattern:
1 2 3 4 5 67 8 9 1011 12 131415Note the last line where 13, 14 and 15 are printed without any space.
Approach...Print the 2x3 rectangular matrix in C
In this article, we have take a look at how to print a rectangular matrix of size 2 * 3 with integers in C Programming Language with numbers from 1 to 6.
The pattern is as follows:
246135Table of contentsProblem statementApproach to solveImplementationOutputProblem statementIn this problem, we have to print the following rectangular matrix of size 2*3:
246135Approach to solve the problemFollowing is the approach to solve this problem:
We can solve this problem by using 2D array....
December 20, 2022
strtol in C++
In this article, we will learn about strtol in C++ and we will also compare it with other similar functions such as strtoul.
Table of contents:
strtol in C++Example of using 'strtol'Example showing strtol() function with different basesComparing strtol with other similar functionsstrtol in C++In C++, the 'strtol' is a STL(Standard Template Library) function that converts a string to a long integer. It is defined in the 'cstdlib' header file.
Following is the general syntax for using 'strt...
December 19, 2022
Detect Ctrl+C and Ctrl+V using JavaScript
In this article, we have explained with code examples how to detect the key presses Ctrl + C and Ctrl + V using JavaScript on a webpage. The two keypresses are mainly used for Copy and Paste.
TABLE OF CONTENTS:
Ctrl+CCtrl+VHow to detect copy paste commands Ctrl+V, Ctrl+C using JavaScriptCtrl+CThis is sometimes called Control+C, ^c, or C-c. Ctrl+C is a keyboard shortcut that is used to copy highlighted text or other object like an image to the clipboard in a browser or illustrative user en...
December 18, 2022
Python script to create GitHub repository
In this article, we have explored the approach to create a Python script to create GitHub repository. In this, we have used GitHub REST API.
Table of contents:
Introduction to GitHubWhat is Git?What is a GitHub repositoryHow to Create a Github pull requestWhat is an API?Applications of GithubIntroduction to GitHubGitHub is a web-based platform that provides version control and collaboration tools for software development. It was founded in 2008 and is now owned by Microsoft.
GitHub allo...
5 Types of Web Servers
A web server is a software application that runs on a computer and is responsible for serving web content, such as HTML pages, to clients over the internet. When a user enters a web address into their web browser, the browser sends a request to the web server, which then responds by sending the requested web page back to the browser. The web server can also handle requests for other types of content, such as images, videos, and audio files.
These servers are designed to handle different workload...
Disable Text Selection, Copy, Cut, Paste and Right-click in JS (JavaScript)
In this article, we will explored how to disable Text Selection, Copy, Cut, Paste and Right-click in JS (JavaScript) with example code and a interactive demo.
TABLE OF CONTENT:-
Introduction How to Disable Text Selection with JavaScript How to Disable Copy, Cut, and Paste with JavaScript How to Disable Right-click with JavaScript Demo IntroductionBefore we delve into the main topic, let us understand what Javascript or as it's popularly called, JS. Javascript is a lan...