Posts

Hello World Program in C++

Hello World Program in C++ The "Hello, World!" program is often the first program beginners write when learning a new programming language. In C++, it's a simple yet powerful way to introduce the basic syntax and structure of the language. Let's break down the components of the C++ "Hello, World!" program: #include <iostream> int main() { std::cout << "Hello, World!" << std::endl; return 0; } Explanation: #include <iostream> : This line includes the iostream header file, which contains declarations for the standard input/output stream objects in C++, such as std::cout and std::endl . int main() : This is the main function of the program. All C++ programs must have a main() function, which serves as the entry point of the program. std::cout << "Hello, World!" << std::endl; : This line uses the std::cout object to output the message "Hello, World!" to...

Functions and Scope

Functions and Scope Functions are essential building blocks in JavaScript, allowing you to encapsulate reusable blocks of code. Understanding functions and scope is crucial for writing efficient and maintainable code. Let's explore these concepts in detail: Declaring and Invoking Functions: In JavaScript, you can declare functions using the function keyword. Functions can take parameters and return values. Here's an example of declaring and invoking a function: // Function declaration function greet(name) { return "Hello, " + name + "!"; } // Function invocation let message = greet("John"); console.log(message); // Output: Hello, John! Understanding Scope and Closures: Scope determines the visibility and lifetime of variables in JavaScript. JavaScript has function scope, meaning variables defined within a function are only accessible within that function. Closures are an important concept in JavaScript, referring to the abil...

JavaScript fundamentals

JavaScript Fundamentals JavaScript fundamentals lay the groundwork for understanding the language's core concepts, including variables and data types, operators and expressions, and control flow structures. Variables and Data Types: In JavaScript, variables are containers for storing data values. Variables can hold various types of data, including numbers, strings, booleans, arrays, objects, and more. Here's an example of declaring and initializing variables: // Variable declaration and initialization let name = "John"; let age = 30; let isStudent = true; let fruits = ["apple", "banana", "orange"]; let person = { firstName: "John", lastName: "Doe" }; Operators and Expressions: Operators in JavaScript allow you to perform operations on variables and values. JavaScript supports various types of operators, including arithmetic, assignment, comparison, logical, and bitwise operators. Expressions are com...

Getting Started with JavaScript

Getting Started with JavaScript Before you begin your journey with JavaScript, it's important to understand the fundamentals and set up your development environment. Let's explore these crucial steps in more detail: Understanding the Basics of JavaScript: JavaScript is a powerful scripting language used primarily for web development. It allows you to add interactivity and dynamic behavior to web pages. JavaScript can manipulate HTML elements, handle events like clicks and mouse movements, and interact with web APIs to fetch and send data. To better understand JavaScript, let's look at a simple example: // JavaScript code to display a message console.log("Hello, JavaScript!"); In this example, we use the console.log() function to display the message "Hello, JavaScript!" in the browser's console. This is a basic example of how JavaScript can be used to perform actions. Setting Up Your Development Environment:...

Mastering JavaScript: A Comprehensive Guide for Beginners

Mastering JavaScript: A Comprehensive Guide for Beginners Mastering JavaScript: A Comprehensive Guide for Beginners Are you ready to embark on a journey to master JavaScript? Whether you're a seasoned developer looking to enhance your skills or a beginner eager to dive into the world of programming, this comprehensive guide will equip you with everything you need to know to become proficient in JavaScript. Introduction: In today's digital age, JavaScript has become one of the most essential programming languages for web development. From creating interactive websites to building powerful web applications, JavaScript plays a pivotal role in shaping the modern web. In this guide, we'll start from the basics and gradually delve into more advanced topics, providing detailed explanations and practical examples along the way. Table of Contents: Getting Started with JavaScript ...

Local Storage in Javascript | HTML5 web storage API

 Local Storage Local Storage is used to store websites data locally on a device. Basically LocalStorage is not a database. LocalStorage provide 5MB of space on user computer. It is use for saving passwords, name, email etc. LocalStorage.setItem The localStorage.setItem is use to set data into localStorage. It can be write as : localStorage.setItem(key, data) ; So the localStorage.setItem has two parameters. The first one use for the key and the second ine use for the data to be store in the localstorage. The key should be in the string.  var data = 12; localStorage.setItem("keyName", data) ; localStorage.getItem  The localStorage.getItem is use to get the data from the localStorage.  localStorage.getItem(key); The l ocalStorage.getItem has only one parameter which is the key. The key of localStorage.getItem should be string.  var data = localStorage.getItem("keyName") ;

Array sorting in c/cpp | Best sorting Algorithm

 Array sorting in Javascript | Best sorting Algorithm So the Question is how to sorting an array. In this blog we will cover how to sort anbarray in Javascript. 

How to get your Current Location with Javascript | HTML5 Geolocation API

 HTML5 Geolocation API We can get our location using HTML5 Geolocation API.  HTML5 Geolocation API is used to return the current position of the users. Any one can get there current location using  HTML5 Geolocation API. Things you should know before using  HTML5 Geolocation API You must have a little knowledge before you starting with  HTML5 Geolocation API are: HTML Javascript HTML is a markup language which is use for designing web page. Javascript   is a programming language which is use to make web page more interactive. HTML5 Geolocation API navigator.geolocation();  //this is use to get geolocation First check if your browser is supporting the navigator.geolocation() :          if(navigator.geolocation){          console.log("Your browser is support this function"); } This will tell you whether your browser is supporting the navigator.geolocation() or not. Use of getCurrentPosition() : The ...

Loops in Javascript | what is loops? | Javascript 2020

Image
 Loops in Javascript Loops In Javascript | Loop Statements is use to create a loop. Basically in Programming loop mean the repeatation of statements. So basically loop statements in Javascript is use to make the statement repeat.  What is the use of Loops?  Loops basically use to repeat a statement. For example, if we got task that print "hello world" 100 time, instant of typing "hello world" 100 we will simply use loop and we will write the statement only one type. There are many uses of loops like initialization of data for array etc.  While Loop While loop is the type of loop which is use to repeat the statement on the basis of condition. While loop will stop only if its condition is false otherwise it will be an infinity loop. For example if we want to print 100 pages on printer  only if the pages is save if not it will be terminated.  Syntax while(condition) { Block of Statements }  In the above syntax if the condition is true the block of statem...

get current date and time in Javascript | Javascript 2020

 How to get current date and time in Javascript We can access date and time most of the language. So how we will get the current date and time? What are the statements use for it? So lets begin. 1. You must know about javascript  To get the current date and time through javascript you must have a little knowledge about javascript language. Basically javascript is a side scripting language use to make websites more dynamic. So you must know about it.  2. Lets start with date  Date inside the javascript is an object which returns a lot of information about date and time such as seconds, minutes etc. To use it we must create an object of date and we will store it in the Variable. See below to understand it clearly.  var date = new Date()  3. What we can access from Date() object?  We can access the following things from Date() object.  Milliseconds  Seconds  Minutes  Hours  Days  Weeks  Months  Years  4. How t...

CSS box shadow | CSS styling

Image
 How to create a box shadow with CSS So how we will create CSS box shadow. To do this you must know little bit about HTML and CSS. So lets do this The follow these step to create box shadow  1. Create new html file.  To create a html file open an editor and save that file with .html extension. Write basic tag of html like html head and body tag. And then save it with .html extension. I personally recommended to install nodepad++. Nodepad++ is color the sytax.  2. Creating box To create box in html we will use div tag as a box. Div tag is work as a container. So div tag is the best tag for creating box.  <div></div> 3. Adding attribute to div tag Attribute is the property of any tag. We will use class attribute for div tag. Class attribute will represent that tag. Do to this we will simply put class="Class Name" . <div class="box" ></div> 4. Now adding style to the box Now we will add style the box. Add style tag between head tag. To acces...

How to send message to a number using HTML | HTML API

 How to send message to a number using HTML So we can send message through HTML. How? We can send sms through <a> tag. <a> tag is use to create link in the web page but we can also send messages through it. To Send messages through link follow these steps: Create and Name your link We can create link using <a> tag. The text between <a> and </a> is the name that are display on a link. You can enter any name between anchor tag. Link attribute  Some tags of HTML has its own attributes. Attributes are the properties of any tags. Anchor <a> tag use href attribute. Href means hypertext reference. Through attribute we can send sms.  Insert Data into Link Basically href is use to put the link of the tag. But in this case we will put number and message body inside href. Example <a href="sms:987654321&body:hi">Send me message</a> Result Send me message When you click on the hyper link it will take you to the message box. 

Make a call-able link in HTML | Call-able link

How to make a call-able link in HTML Html provide an easy way to make  a call able link. You can add this link to your blog or site.  Thes step will create a call able link.  If you already know about html it is very easy for your.  Create a link using anchor tag <a> In the href area put tel:your number Between <a> and </a> put your your name, number or some text to make it click able.  Example <a href="tel:987654321" >Call me</a> This will show you some thing like that Call me Example <a href="tel:987654321" >9+987654321</a> This will show you some thing like that +987654321 When you click the link it will redirect you to the dial pad and the number will be entered in the log automatically.  Warning Do not use + plus sign in the href with the number. Just simply entered your number and when you click on the link it will redirect you to the dial pad. 

Introduction to Python

 What is Python? Python is a famous programming language. It was created by Guido van Rossum. It was release in 1991. Python is use for:  Web development  Software development Solve Mathematics Problems System scripting  Is Python is easy  programming language? Yes Python is very easy to learn. Bracket use in python is vary rare. It can be use as a beginner language. Is Python use for Hacking? Yes, Python can be use for hacking. Most of the Hacking tools is programmed with python. What Python can do? Python can be use to create Database App. Python can be use to create Web Development. Python can be use to handle big data. Python can be use to create software development.

HTML Formatting | HTML 2020

 HTML Formatting If you use Word processing you must know about formatting. Formatting is the process to change the layout of the  documents. Word processing provide us many formatting tools such as bold, italic, strick through etc. Similarly HTML provide its users to do such task with coding. Basic HTML Formatting Elements  The basic elements use for formatting HTML pages are  Bold Italic  Underline  Strick through  So we will define these one by one with examples and showing its output.  Bold  Bold <b> tag is use to bold the text. It begin with <b> and end with </b>. The text between <b> and </b> will be bold. This tag is use when we needed to bold something in our document. You can use more than one <b> tag. Example < html > < head >           < title > Bold </ title > </ head > < body >      < p > This...

Paragraph in HTML | HTML paragraph

 Paragraph In HTML HTML paragraph is use to display paragraph on web page. <p> tag is use for paragraph. Paragraph tag start with <p> and end with </p>. Paragraph is display text. Example < html > < head >           < title > Paragraph </ title > </ head > < body >      < p > This is a simple paragraph </ p > </ body > </ html > Result This is a simple paragraph Horizontal Line in HTML The <hr> tag defines a thematic break in an HTML page. It will draw a horizontal line between two tags. It has no ending tag. Example < html > < head >           < title > Paragraph </ title > </ head > < body >      < p > This is a  < br >  simple paragraph </ p > </ body > </ html > Result...

What is HTML? | HTML 2020

 What is HTML? HTML is stand for H yper T ext M arkup   L anguage. HTML is a Markup language which is used for Web Development. HTML tell the browser how to display a page. HTML use tags start and end tags HTML is not a programming language. How is the Structure of HTML < html > < head >           < title > What is HTML </ title > </ head > < body >      </ body > </ html > <html> is the start tag of HTML and it is end with </html> at the bottom of page. . Every HTML tag is start with <Name of tag> and end with </Name of Tag> The second tag is <head> which is use for providing information about the page such as title etc. <title> tag is use to display the title of the page. it end with </title> The fourth is <body> tag. Whatever we watch on the web page, placed inside the <body> tag. <body> tag is...

How to create side navigation menu

Image
 How to create side navigation menu Side navigation menu is menu which placed either on the  left side of the or on the right side on the page. so today we are going to create it . How to build First create a div and inside div create ul . Now add <li> you want and inside <li> add <a> tag. Add style and you will get this. Here is the code <! DOCTYPE   html > < html > < head > < title ></ title > < style   type = "text/css" > html ,  body { padding  : 0 ; margin  : 0 ; font-family : Arial, Helvetica, sans-serif; } .side-nav { position  :fixed ; display  :block; width  : 300px ; height  : 100% ; box-shadow : 0   0   8px   8px  rgba( 0 , 0 , 0 , 0.2 ); overflow-x :hidden ; } .side-nav   ul { display  :block ; padding  : 0 ; } .side-nav   ul   li { list-style-type  :none ; margin-left  : 10px ; ...

How to create responsive form in css

Image
 How to create responsive form in css In this post we are going to show you how to create a responsive form with html and css. It is very easy to create and designing of responsive Form like this. In this form we have created two input field whcih is beautifully designed with css  button and a link.  It is very responsive and is very easy for everyone to create form like that.  Here is the code . <! DOCTYPE   html > < html > < head > < title ></ title > < style   type = "text/css" > .flow-text { font-weight  : 200 ; font-size  : 20px ; color :#222; background  :rgba( 140 , 20 , 20 , 0.1 ) ; padding : 5px ; border-radius  : 3px  ; } p { font-weight  : 250 ; font-size  : 16px ; } .input { width :auto; height : auto; padding-top :  7px ; padding-bottom :  7px ; border : 1px  solid #ddd; outline :  0 ; border : 1px  solid #ddd; transition : .5s ; ...

Create slote machine game using Javascript and Html

Image
 Create slot  machine game using Javascript and Html In this post we will create a simple slot machine game using  javascript and Html. How it work Simple slot machine game created with javascript and html. It work base on the random number generator and We set time Interval It will give you 100 coin at the begining  At each roll it will cut 10 coin from yours coin If all the number are same then you will get 100 coin If the numbers are not same then you will get the fail message Enjoy the game rate my game out of 10. If you have any problem regarding to any thing in javascript and html  or you have some ideas then tell us in the command box. Here is the code <! DOCTYPE   html > < html > < head > < title ></ title > < style   type = "text/css" > .game-area  { padding  : 10px ; margin  : 5px ; background  :transparent ; box-shadow  : 0   0   8px   8px  rgba( 0 , 0 , 0 ...