CINXE.COM
Number Theory: Definition, Topics, Examples & Problems
<!DOCTYPE html> <!--[if IE 7]> <html class="ie ie7" lang="en-US" prefix="og: http://ogp.me/ns#"> <![endif]--> <!--[if IE 8]> <html class="ie ie8" lang="en-US" prefix="og: http://ogp.me/ns#"> <![endif]--> <!--[if !(IE 7) | !(IE 8) ]><!--> <html lang="en-US" prefix="og: http://ogp.me/ns#" > <!--<![endif]--> <head> <meta charset="UTF-8" /> <meta name="keywords" content="Data Structures,Algorithms,Python,Java,C,C++,JavaScript,Android Development,SQL,Data Science,Machine Learning,PHP,Web Development,System Design,Tutorial,Technical Blogs,Interview Experience,Interview Preparation,Programming,Competitive Programming,Jobs,Coding Contests,GATE CSE,HTML,CSS,React,NodeJS,Placement,Aptitude,Quiz,Computer Science,Programming Examples,GeeksforGeeks Courses,Puzzles,SSC,Banking,UPSC,Commerce,Finance,CBSE,School,k12,General Knowledge,News,Mathematics,Exams" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=3.0"> <link rel="shortcut icon" href="https://media.geeksforgeeks.org/wp-content/cdn-uploads/gfg_favicon.png" type="image/x-icon" /> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <meta name="theme-color" content="#308D46" /> <meta name='robots' content='index, follow, max-image-preview:large, max-snippet:-1' /> <meta name="image" property="og:image" content="https://media.geeksforgeeks.org/wp-content/cdn-uploads/gfg_200x200-min.png"> <meta property="og:image:type" content="image/png"> <meta property="og:image:width" content="200"> <meta property="og:image:height" content="200"> <meta name="facebook-domain-verification" content="xo7t4ve2wn3ywfkjdvwbrk01pvdond" /> <script src="https://cdnads.geeksforgeeks.org/synchronously_gfg_ads.min.js"></script> <script defer src="https://apis.google.com/js/platform.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.14/require.min.js"></script> <!-- Removed the below script from here to prevent loading google translate js at initial load <script async src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> --> <!-- FIXME:- To be finalised whether we need to put this gpt script in header or footer --> <!-- //gpt.js script --> <!-- <script async src='https://www.googletagservices.com/tag/js/gpt.js'></script> --> <script> var IHPWT={}; //Initialize Namespace var pbjs = pbjs || {}; pbjs.que = pbjs.que || []; var googletag = googletag || {}; googletag.cmd = googletag.cmd || []; var gptRan = false; </script> <script defer src="https://ads.pubmatic.com/AdServer/js/pwt/162080/12331/pwt.js"></script> <script defer src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script> <script defer src="https://cdnads.geeksforgeeks.org/prebid.js?ver=0.1"></script> <script defer src="https://cdnads.geeksforgeeks.org/gfg_ads.min.js?ver=0.1"></script> <!-- gfg tabs compatablity bundled js --> <title>Number Theory: Definition, Topics, Examples & Problems</title> <link rel="profile" href="http://gmpg.org/xfn/11" /> <link rel="pingback" href="" /> <!--[if lt IE 9]> <script src="https://www.geeksforgeeks.org/wp-content/themes/iconic-one/js/html5.js" type="text/javascript"></script> <![endif]--> <!-- Video Schema for posts only --> <script> var video_api_response = JSON.parse("{\"id\":9260,\"title\":\"Number Theory\",\"slug\":\"number-theory\",\"description\":\"<h2>An Introduction to Number Theory<\/h2><p>In this video, we explore the fascinating world of Number Theory, a branch of mathematics that deals with the properties and relationships of numbers, particularly integers. This tutorial is perfect for students, professionals, or anyone with a keen interest in mathematics.<\/p><h3>Understanding Number Theory<\/h3><p>Number Theory is one of the oldest and most intriguing fields of mathematics. It encompasses a wide range of topics from the basic properties of numbers to the more complex structures and theories. In this video, we will introduce you to the fundamental concepts and highlight some key areas of study.<\/p><h3>Key Concepts in Number Theory<\/h3><ul><li><strong>Prime Numbers:<\/strong> Learn about prime numbers, their properties, and why they are considered the building blocks of number theory. We will discuss various methods to identify prime numbers and their significance in mathematics.<\/li><li><strong>Divisibility and Factors:<\/strong> Understand the rules of divisibility and how to find the factors of a number. This section will cover concepts like greatest common divisors and least common multiples.<\/li><li><strong>Modular Arithmetic:<\/strong> Discover the importance of modular arithmetic in number theory. We\u2019ll explain how to perform calculations with remainders and explore its applications in areas such as cryptography.<\/li><li><strong>Fermat\u2019s Little Theorem:<\/strong> Get introduced to one of the key theorems in number theory, Fermat's Little Theorem, which has profound implications in the field of cryptography and primality testing.<\/li><\/ul><h3>Practical Applications<\/h3><ul><li><strong>Cryptography:<\/strong> Learn how number theory is applied in cryptography, the practice of secure communication in the presence of third parties. We\u2019ll discuss how prime numbers and modular arithmetic form the backbone of many encryption algorithms.<\/li><li><strong>Computer Science:<\/strong> Explore the role of number theory in computer science, particularly in algorithms and data structures. Number theory principles are fundamental in hashing, random number generation, and error detection.<\/li><\/ul><h2>Additional Resources<\/h2><p>For more detailed information and a comprehensive guide to number theory, check out the full article on GeeksforGeeks: <a href=\\\"https:\/\/www.geeksforgeeks.org\/number-theory\/\\\">https:\/\/www.geeksforgeeks.org\/number-theory\/<\/a>. This article provides in-depth explanations, examples, and further readings to enhance your understanding of number theory.<\/p><p>By the end of this video, you\u2019ll have a solid foundation in number theory and an appreciation for its applications in various fields. Whether you're a student preparing for exams or a professional looking to deepen your knowledge, this video will provide valuable insights.<\/p><p><strong>Read the full article for more details:<\/strong> <a href=\\\"https:\/\/www.geeksforgeeks.org\/number-theory\/\\\">https:\/\/www.geeksforgeeks.org\/number-theory\/<\/a>.<\/p><p>Thank you for watching!<\/p>\",\"source\":\"https:\/\/videos.geeksforgeeks.org\/hls\/dd7ed2ae72a7975efb1e5b5f2faa6f1egfg-numbertheory20240606182650.m3u8\",\"category\":[{\"term_id__id\":15,\"term_id__term_name\":\"Maths\",\"term_id__term_type\":1,\"term_id__slug\":\"maths\"},{\"term_id__id\":16,\"term_id__term_name\":\"Maths\",\"term_id__term_type\":2,\"term_id__slug\":\"maths-kwitto\"}],\"video_type\":\"geeksforgeeks\",\"meta\":{\"thumbnail\":\"https:\/\/media.geeksforgeeks.org\/geeksforgeeks\/NumberTheory\/numbertheory120240606182653-small.png\",\"largeThumbnail\":\"https:\/\/media.geeksforgeeks.org\/geeksforgeeks\/NumberTheory\/numbertheory120240606182653.png\",\"likes\":0,\"views\":560,\"isFeatured\":0,\"isPremium\":0,\"isPublic\":0,\"format\":\"video\/mp4\",\"revision\":{}},\"time\":\"28\/06\/2024\",\"seo\":{\"description\":\"<h2>An Introduction to Number Theory<\/h2><p>In this video, we explore the f\",\"thumbnail\":\"https:\/\/media.geeksforgeeks.org\/geeksforgeeks\/NumberTheory\/numbertheory120240606182653-seo.png\"},\"subtitle\":\"https:\/\/videos.geeksforgeeks.org\/subtitles\/numbertheory20240606182650.vtt\",\"duration\":635,\"post_list\":[{\"post_id\":612013,\"post_title\":\"Number Theory in Mathematics\"}],\"course_link\":null,\"views\":\"560\",\"video_schema\":{\"@context\":\"https:\/\/schema.org\",\"@type\":\"VideoObject\",\"name\":\"Number Theory\",\"description\":\"An Introduction to Number TheoryIn this video, we explore the fascinating world of Number Theory, a branch of mathematics that deals with the properties and relationships of numbers, particularly integers. This tutorial is perfect for students, professionals, or anyone with a keen interest in mathematics.Understanding Number TheoryNumber Theory is one of the oldest and most intriguing fields of mathematics. It encompasses a wide range of topics from the basic properties of numbers to the more complex structures and theories. In this video, we will introduce you to the fundamental concepts and highlight some key areas of study.Key Concepts in Number TheoryPrime Numbers Learn about prime numbers, their properties, and why they are considered the building blocks of number theory. We will discuss various methods to identify prime numbers and their significance in mathematics.Divisibility and Factors Understand the rules of divisibility and how to find the factors of a number. This section will cover concepts like greatest common divisors and least common multiples.Modular Arithmetic Discover the importance of modular arithmetic in number theory. Well explain how to perform calculations with remainders and explore its applications in areas such as cryptography.Fermats Little Theorem Get introduced to one of the key theorems in number theory, Fermats Little Theorem, which has profound implications in the field of cryptography and primality testing.Practical ApplicationsCryptography Learn how number theory is applied in cryptography, the practice of secure communication in the presence of third parties. Well discuss how prime numbers and modular arithmetic form the backbone of many encryption algorithms.Computer Science Explore the role of number theory in computer science, particularly in algorithms and data structures. Number theory principles are fundamental in hashing, random number generation, and error detection.Additional ResourcesFor more detailed information and a comprehensive guide to number theory, check out the full article on GeeksforGeeks httpswww.geeksforgeeks.orgnumber-theory. This article provides in-depth explanations, examples, and further readings to enhance your understanding of number theory.By the end of this video, youll have a solid foundation in number theory and an appreciation for its applications in various fields. Whether youre a student preparing for exams or a professional looking to deepen your knowledge, this video will provide valuable insights.Read the full article for more details httpswww.geeksforgeeks.orgnumber-theory.Thank you for watching\",\"thumbnailUrl\":[\"https:\/\/media.geeksforgeeks.org\/geeksforgeeks\/NumberTheory\/numbertheory120240606182653-small.png\",\"https:\/\/media.geeksforgeeks.org\/geeksforgeeks\/NumberTheory\/numbertheory120240606182653.png\",\"https:\/\/media.geeksforgeeks.org\/geeksforgeeks\/NumberTheory\/numbertheory120240606182653-seo.png\"],\"uploadDate\":\"2024-06-28T15:30:09Z\",\"duration\":\"PT0H10M35S\",\"contentUrl\":\"https:\/\/www.geeksforgeeks.org\/videos\/number-theory\/\"}}"); </script> <script type="application/ld+json">{"@context":"https://schema.org","@type":"VideoObject","name":"Number Theory","description":"An Introduction to Number TheoryIn this video, we explore the fascinating world of Number Theory, a branch of mathematics that deals with the properties and relationships of numbers, particularly integers. This tutorial is perfect for students, professionals, or anyone with a keen interest in mathematics.Understanding Number TheoryNumber Theory is one of the oldest and most intriguing fields of mathematics. It encompasses a wide range of topics from the basic properties of numbers to the more complex structures and theories. In this video, we will introduce you to the fundamental concepts and highlight some key areas of study.Key Concepts in Number TheoryPrime Numbers Learn about prime numbers, their properties, and why they are considered the building blocks of number theory. We will discuss various methods to identify prime numbers and their significance in mathematics.Divisibility and Factors Understand the rules of divisibility and how to find the factors of a number. This section will cover concepts like greatest common divisors and least common multiples.Modular Arithmetic Discover the importance of modular arithmetic in number theory. Well explain how to perform calculations with remainders and explore its applications in areas such as cryptography.Fermats Little Theorem Get introduced to one of the key theorems in number theory, Fermats Little Theorem, which has profound implications in the field of cryptography and primality testing.Practical ApplicationsCryptography Learn how number theory is applied in cryptography, the practice of secure communication in the presence of third parties. Well discuss how prime numbers and modular arithmetic form the backbone of many encryption algorithms.Computer Science Explore the role of number theory in computer science, particularly in algorithms and data structures. Number theory principles are fundamental in hashing, random number generation, and error detection.Additional ResourcesFor more detailed information and a comprehensive guide to number theory, check out the full article on GeeksforGeeks httpswww.geeksforgeeks.orgnumber-theory. This article provides in-depth explanations, examples, and further readings to enhance your understanding of number theory.By the end of this video, youll have a solid foundation in number theory and an appreciation for its applications in various fields. Whether youre a student preparing for exams or a professional looking to deepen your knowledge, this video will provide valuable insights.Read the full article for more details httpswww.geeksforgeeks.orgnumber-theory.Thank you for watching","thumbnailUrl":["https://media.geeksforgeeks.org/geeksforgeeks/NumberTheory/numbertheory120240606182653-small.png","https://media.geeksforgeeks.org/geeksforgeeks/NumberTheory/numbertheory120240606182653.png","https://media.geeksforgeeks.org/geeksforgeeks/NumberTheory/numbertheory120240606182653-seo.png"],"uploadDate":"2024-06-28T15:30:09Z","duration":"PT0H10M35S","contentUrl":"https://www.geeksforgeeks.org/videos/number-theory/"}</script> <!-- adding article schema markup --> <!--POST SCHEMA through API--> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Article", "mainEntityOfPage": { "@type": "WebPage", "id": "https://www.geeksforgeeks.org/number-theory/" }, "headline": "Number Theory in Mathematics", "datePublished": "2021-11-11 12:42:56", "dateModified": "2024-07-31 04:10:33", "image": { "@type": "ImageObject", "url": "https://media.geeksforgeeks.org/wp-content/uploads/20231005172352/Screenshot-from-2023-10-04-17-19-31-min.png", "width": "991", "height": "466" }, "author": { "@type": "Organization", "name": "GeeksforGeeks", "url": "https://www.geeksforgeeks.org/", "logo": { "@type": "ImageObject", "url": "https://media.geeksforgeeks.org/wp-content/cdn-uploads/logo-new-2.svg", "width": "301", "height": "40" } }, "publisher": { "@type": "Organization", "name": "GeeksforGeeks", "url": "https://www.geeksforgeeks.org/", "logo": { "@type": "ImageObject", "url": "https://media.geeksforgeeks.org/wp-content/cdn-uploads/logo-new-2.svg", "width": "301", "height": "40" } }, "description": "Number Theory is the branch of mathematics that deals with the study of positive numbers and arithmetic operations based on them. Numbers are the mathematical entities that are used for counting. Since the development of human civilization, numbers have always been a source of fascination for various mathematicians across the", "about": [ { "@type": "Thing", "name": "Maths" }, { "@type": "Thing", "name": "SchoolLearning" }, { "@type": "Thing", "name": "MathsCategories" }, { "@type": "Thing", "name": "Tutorials" } ] }</script> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "WebSite", "url": "https://www.geeksforgeeks.org/", "potentialAction": { "@type": "SearchAction", "target": "https://www.geeksforgeeks.org/search/{search_term_string}/", "query-input": "required name=search_term_string" } }</script> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Organization", "name": "GeeksforGeeks", "url": "https://www.geeksforgeeks.org/", "logo": "https://media.geeksforgeeks.org/wp-content/cdn-uploads/20200817185016/gfg_complete_logo_2x-min.png", "description": "A computer science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.", "founder": [ { "@type": "Person", "name": "Sandeep Jain", "url": "https://in.linkedin.com/in/sandeep-jain-b3940815" } ], "sameAs": [ "https://www.facebook.com/geeksforgeeks.org/", "https://twitter.com/geeksforgeeks", "https://www.linkedin.com/company/1299009", "https://www.youtube.com/geeksforgeeksvideos/" ] }</script> <script type="application/ld+json">{ "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [ { "@type": "Question", "name": "What is Number Theory?", "acceptedAnswer": { "@type": "Answer", "text": "Number Theory or Theory of Numbers is a branch of mathematics that deals with positive numbers and its applications." } }, { "@type": "Question", "name": "Who are Credited to have First Developed the Number Theory?", "acceptedAnswer": { "@type": "Answer", "text": "People of Babyloian Civilization are credited to have first developed the concept of Number Theory." } }, { "@type": "Question", "name": "Who are some popular Number Theorists?", "acceptedAnswer": { "@type": "Answer", "text": "Some of the popular Number Theorists include Pythagoras, Euclid, Fermat, Gauss, Aryanhatta, Brahmagupt and Ramanujan." } }, { "@type": "Question", "name": "What are the Branches of Number Theory?", "acceptedAnswer": { "@type": "Answer", "text": "The different Branches of Number Theory are Elementary Number Theory, Algebraic Number Theory, AnalyticaL Number Theory and Dipohantine Number Theory." } }, { "@type": "Question", "name": "What is Pythagorean Triplet?", "acceptedAnswer": { "@type": "Answer", "text": "Pythagorean Triplet is a collection of three numbers such that the square of the largest number is equal to the sum of the squares of the rest two numbers." } }, { "@type": "Question", "name": "What are the different Numbers System in which Numbers can be written?", "acceptedAnswer": { "@type": "Answer", "text": "The different forms in which numbers can be written are Binary System, Decimal System, Octal System and Hexadecimal System." } }, { "@type": "Question", "name": "What is Hardy Ramanujan Number?", "acceptedAnswer": { "@type": "Answer", "text": "1729 is known as Hardy Ramanujan Number as it can be represented as sum of cubes of two different pairs of number. 1729 = 123 + 13 and also 1729 = 103 + 93" } }, { "@type": "Question", "name": "Which is the only Even Prime Number?", "acceptedAnswer": { "@type": "Answer", "text": "2 is the only even prime number." } }, { "@type": "Question", "name": "What is BODMAS?", "acceptedAnswer": { "@type": "Answer", "text": "BODMAS stands for Bracket, Of, Division, Multiplication, Addition and Subtraction. It is the order of priority to solving the operations where Bracket operations to be done first and subtraction to be done at last." } }, { "@type": "Question", "name": "Who is the Father of Number Theory?", "acceptedAnswer": { "@type": "Answer", "text": "Pierre de Fermat is regarded as the father of Number Theory." } } ] }</script> <script> var arrPostCat = new Array(); var arrPostCatName="Mathematics"; arrPostCat.push('4667'); arrPostCat.push('4677'); var tIds = "4667,4677,7014,6527"; var termsNames = "Mathematics,SchoolLearning,MathsCategories,Tutorials"; var tIdsInclusiveParents = "4667,4677,7014,6527" var domain = 1; var arrPost = new Array(); var post_id = "612013"; var post_type = "post"; var post_slug = window.location.href; var ip = "64.252.72.128"; var post_title = `Number Theory in Mathematics`; var post_status = "publish"; var practiceAPIURL="https://practiceapi.geeksforgeeks.org/"; var practiceURL="https://practice.geeksforgeeks.org/"; var post_date = "2021-11-11 00:42:56"; var commentSysUrl = "https://discuss.geeksforgeeks.org/commentEmbedV2.js"; //var postAdApiUrlString = ""; var link_on_code_run = ''; var link_search_modal_top = ''; var country_code_cf = "RU"; var postAdApiUrlString = '4677/4667/4677/7014/6527/'; </script> <!-- This site is optimized with the Yoast SEO plugin v7.6 - https://yoast.com/wordpress/plugins/seo/ --> <meta name="description" content="Number theory is a branch of mathematics that deals with the properties and relationships of numbers, particularly integers. In this article, we will discuss about this branch in brief."/> <link rel="canonical" href="https://www.geeksforgeeks.org/number-theory/" /> <meta property="og:locale" content="en_US" /> <meta property="og:type" content="article" /> <meta property="og:title" content="Number Theory: Definition, Topics, Examples & Problems" /> <meta property="og:description" content="Number theory is a branch of mathematics that deals with the properties and relationships of numbers, particularly integers. In this article, we will discuss about this branch in brief." /> <meta property="og:url" content="https://www.geeksforgeeks.org/number-theory/" /> <meta property="og:site_name" content="GeeksforGeeks" /> <meta property="article:tag" content="Maths-Categories" /> <meta property="article:tag" content="Tutorials" /> <meta property="article:section" content="Mathematics" /> <meta property="article:published_time" content="2021-11-11T00:42:56+00:00" /> <meta property="article:modified_time" content="2024-07-31T16:10:27+00:00" /> <meta property="og:updated_time" content="2024-07-31T16:10:27+00:00" /> <meta property="og:image" content="https://media.geeksforgeeks.org/wp-content/uploads/20231005172352/Screenshot-from-2023-10-04-17-19-31-min.png" /> <meta property="og:image:secure_url" content="https://media.geeksforgeeks.org/wp-content/uploads/20231005172352/Screenshot-from-2023-10-04-17-19-31-min.png" /> <script type='application/ld+json'>{"@context":"https:\/\/schema.org","@type":"Organization","url":"https:\/\/www.geeksforgeeks.org\/","sameAs":[],"@id":"https:\/\/www.geeksforgeeks.org\/#organization","name":"GeeksforGeeks","logo":"http:\/\/www.geeksforgeeks.org\/wp-content\/uploads\/gfg_200X200-1.png"}</script> <!-- / Yoast SEO plugin. --> <link rel='dns-prefetch' href='//www.geeksforgeeks.org' /> <link rel='dns-prefetch' href='//s.w.org' /> <script type="text/javascript"> window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/11\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/11\/svg\/","svgExt":".svg","source":{"concatemoji":"https:\/\/www.geeksforgeeks.org\/wp-includes\/js\/wp-emoji-release.min.js?ver=4.9.8"}}; !function(a,b,c){function d(a,b){var c=String.fromCharCode;l.clearRect(0,0,k.width,k.height),l.fillText(c.apply(this,a),0,0);var d=k.toDataURL();l.clearRect(0,0,k.width,k.height),l.fillText(c.apply(this,b),0,0);var e=k.toDataURL();return d===e}function e(a){var b;if(!l||!l.fillText)return!1;switch(l.textBaseline="top",l.font="600 32px Arial",a){case"flag":return!(b=d([55356,56826,55356,56819],[55356,56826,8203,55356,56819]))&&(b=d([55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447],[55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447]),!b);case"emoji":return b=d([55358,56760,9792,65039],[55358,56760,8203,9792,65039]),!b}return!1}function f(a){var c=b.createElement("script");c.src=a,c.defer=c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var g,h,i,j,k=b.createElement("canvas"),l=k.getContext&&k.getContext("2d");for(j=Array("flag","emoji"),c.supports={everything:!0,everythingExceptFlag:!0},i=0;i<j.length;i++)c.supports[j[i]]=e(j[i]),c.supports.everything=c.supports.everything&&c.supports[j[i]],"flag"!==j[i]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[j[i]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(h=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",h,!1),a.addEventListener("load",h,!1)):(a.attachEvent("onload",h),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),g=c.source||{},g.concatemoji?f(g.concatemoji):g.wpemoji&&g.twemoji&&(f(g.twemoji),f(g.wpemoji)))}(window,document,window._wpemojiSettings); </script> <style type="text/css"> img.wp-smiley, img.emoji { display: inline !important; border: none !important; box-shadow: none !important; height: 1em !important; width: 1em !important; margin: 0 .07em !important; vertical-align: -0.1em !important; background: none !important; padding: 0 !important; } </style> <link rel='stylesheet' id='custom-style-css' href='https://www.geeksforgeeks.org/wp-content/themes/iconic-one/css/gfg.min.css?ver=11.73' type='text/css' media='all' /> <script type='text/javascript' src='https://code.jquery.com/jquery-3.7.1.min.js?ver=3.7.1'></script> <script type='text/javascript' src='https://code.jquery.com/jquery-migrate-3.5.2.min.js?ver=3.5.2'></script> <script type='text/javascript'> /* <![CDATA[ */ var gfgObject = {"authUrl":"https:\/\/auth.geeksforgeeks.org\/","writeApiUrl":"https:\/\/apiwrite.geeksforgeeks.org\/","writeUrl":"https:\/\/write.geeksforgeeks.org\/","utilUrl":"https:\/\/util.geeksforgeeks.org\/","apiUrl":"https:\/\/api.geeksforgeeks.org\/","cfApiUrl":"https:\/\/gfgapi.geeksforgeeks.org\/","baseCompilerURL":"https:\/\/codejudge.geeksforgeeks.org\/","idePageBaseUrl":"https:\/\/ide.geeksforgeeks.org\/","gfgApiScriptUrl":"https:\/\/apiscript.geeksforgeeks.org\/","gfgSiteUrl":"https:\/\/www.geeksforgeeks.org\/","curatedListId":"1","curatedListTitle":"SDE Sheet Problems","utilDjangoCfUrl":"https:\/\/utilapi.geeksforgeeks.org\/","premiumCheckoutSlug":"premium-plans-payment\/","premiumLandingSlug":"premium-plans\/","premiumCssUrl":"https:\/\/www.geeksforgeeks.org\/wp-content\/themes\/iconic-one\/css\/gfgpremium.min.css?ver=1.6","premiumJsUrl":"https:\/\/www.geeksforgeeks.org\/wp-content\/themes\/iconic-one\/js\/gfgpremium.min.js?ver=1.5","utilGoogleUrl":"https:\/\/ugprod.geeksforgeeks.org\/","communityApiUrl":"https:\/\/communityapi.geeksforgeeks.org\/","utilDjangoUrl":"https:\/\/gfgutil.geeksforgeeks.org\/","gfgPracticeUrl":"https:\/\/practiceapi.geeksforgeeks.org\/","gfgMediaUrl":"https:\/\/media.geeksforgeeks.org\/","authDjangoApiUrl":"https:\/\/authapi.geeksforgeeks.org\/","gfgMlApiUrl":"https:\/\/recommendations.geeksforgeeks.org\/","is_home":"","is_category":"","userlevelPremiumPlus":"2","practiceUrl":"https:\/\/practice.geeksforgeeks.org\/","gfgNotificationsApiUrl":"https:\/\/notificationsapi.geeksforgeeks.org\/"}; /* ]]> */ </script> <script type='text/javascript' async="async" src='https://www.geeksforgeeks.org/wp-content/themes/iconic-one/js/gfg.min.js?ver=13.36'></script> <link rel='shortlink' href='https://www.geeksforgeeks.org/?p=612013' /> <style> #wpadminbar{ background: #ff0000 !important; } </style> <style type="text/css" id="custom-background-css"> body.custom-background { background-color: #ffffff; } </style> <link rel="icon" href="https://www.geeksforgeeks.org/wp-content/uploads/gfg_200X200-100x100.png" sizes="32x32" /> <link rel="icon" href="https://www.geeksforgeeks.org/wp-content/uploads/gfg_200X200.png" sizes="192x192" /> <link rel="apple-touch-icon-precomposed" href="https://www.geeksforgeeks.org/wp-content/uploads/gfg_200X200.png" /> <meta name="msapplication-TileImage" content="https://www.geeksforgeeks.org/wp-content/uploads/gfg_200X200.png" /> <!-- <script type='text/javascript'> var googletag = googletag || {}; googletag.cmd = googletag.cmd || []; (function() { var gads = document.createElement('script'); gads.async = true; gads.type = 'text/javascript'; var useSSL = 'https:' == document.location.protocol; gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js'; var node = document.getElementsByTagName('script')[0]; node.parentNode.insertBefore(gads, node); })(); </script> AutoAds <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <script> (adsbygoogle = window.adsbygoogle || []).push({ google_ad_client: "ca-pub-9465609616171866", enable_page_level_ads: true }); </script> --> <style> #internal-promo-section{ display: none !important; } @media screen and (max-width:1500px) and (min-width:1280px){ body.single .article-page_flex .leftBar { flex-basis: calc(100% - 605px); max-width: calc(100% - 605px); min-width: calc(100% - 605px); } .sidebar_wrapper{ max-width: 300px; min-width: 300px; } div#secondary { min-width: 300px; max-width: 300px; } .widget-area{ padding: 0px; } .article-page_flex .rightBar{ padding: 20px 0px 0px 0px; } .article--viewer_content .a-wrapper .content { padding: 0px 10px 55px 20px; } .oinLeftbar { height: calc(100vh - 350px) !important; } } .autoLeftBar_oin_child{ height: 100% !important; } .autoLeftBar_oin_non_sticky{ height: unset !important; } .sideBar--wrap.newLeftbar > div[id^='GFG_AD_Leftsidebar_']:nth-of-type(1){ padding-top: 20px; } .sideBar--wrap.newLeftbar > div[id^='GFG_AD_Leftsidebar_']{ padding: 5px 0; } @media (max-width:1043px) and (min-width:992px) { .hide-1043992 { display: none!important; } } .mobile-header-list-item{ padding-left:30px; padding-right:10px; margin-top:5px; } .mobile-header-list{ border-bottom: 1px solid rgba(158, 158, 158, 0.3) !important; } .mobile-header-list .dropdown-title{ border-bottom: none !important; font-size: 16px!important; padding: 0px!important; padding-left: 45px!important; font-weight: normal; } .mobile-header-list .upside::after{ transform: rotate(180deg); } </style> <!-- End Google Tag Manager --> <!-- Global site tag (gtag.js) - Google Ads: 474915276 --> <!-- <script async src="https://www.googletagmanager.com/gtag/js?id=AW-474915276"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'AW-474915276'); </script> --> </head> <body class="post-template-default single single-post postid-612013 single-format-standard custom-background custom-background-white"> <script> // Dark mode script const gfgThemeList = Object.freeze({ LIGHT: "gfgThemeLight", DARK: "gfgThemeDark" }) const getThemeFromCookie = () => { let gfg_def_theme = ""; let cookies = document.cookie; let cooks = cookies.split(";"); for (let i = 0; i < cooks.length; i++) { let icook = cooks[i].split("="); if (icook[0].trim() == "gfg_theme") { gfg_def_theme = icook[1].trim(); } } return gfg_def_theme } if(!(post_slug.includes('premium-plans-payment/') || post_slug.includes('premium-plans/'))){ var isDarkMode = getThemeFromCookie() == gfgThemeList.DARK ? true : false; document.querySelector("body").setAttribute("data-dark-mode", isDarkMode); } function setSearchBarFocus() { const myTimeout = setTimeout(searchBarFocus, 0); function searchBarFocus() { document.getElementById("gcse-search-input").focus(); } } </script> <!-- <div class="header-main__wrapper not-fixed"> --> <nav> <div class="header-main__wrapper"> <a class="gfg-stc" style="top:0" href="#main">Skip to content</a> <a href="https://www.geeksforgeeks.org/" aria-label="Logo" class="header-main__logo"> <div class="_logo"> <!-- Original Logo --> <img class="gfg_logo_img" style="height: 30px; width: 80px; max-width: fit-content;" src="https://media.geeksforgeeks.org/gfg-gg-logo.svg" alt="geeksforgeeks"> </div> </a> <div class="header-main__container"> <!-- for mobile only --> <!-- For Web view only --> <ul class="header-main__list"><li class="header-main__list-item Header_1" data-parent="false" aria-expanded="true" data-expandable="true"><span>Courses</span><i class="gfg-icon gfg-icon_arrow-down gfg-icon_header"></i><ul class="mega-dropdown Screen_1"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/dsa-to-development-coding-guide?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">DSA to Development</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/data-science-live?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">Machine Learning & Data Science</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/mastering-generative-ai-and-chat-gpt?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">Generative AI & ChatGPT</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/search?query=AWS&itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">Become AWS Certified</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>DSA Courses</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/dsa-self-paced?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">Data Structure & Algorithm(C++/JAVA)</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/Data-Structures-With-Python?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">Data Structure & Algorithm(Python)</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/data-structures-and-algorithms-in-javascript?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">Data Structure & Algorithm(JavaScript)</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Programming Languages</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/cpp-programming-basic-to-advanced?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">CPP</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/Java-Programming-basic-to-advanced?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">Java</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/Python-Foundation?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">Python</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/javascript?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">JavaScript</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses/c-Programming-basic-to-advanced?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">C</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/courses?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses" target="_self">All Courses</a></li></ul></li><li class="header-main__list-item Header_2" data-parent="false" aria-expanded="true" data-expandable="true"><span>Tutorials</span><i class="gfg-icon gfg-icon_arrow-down gfg-icon_header"></i><ul class="mega-dropdown Screen_1"><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Python Tutorial</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/taking-input-in-python/?ref=outind" target="_self">Taking Input in Python</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-operators/?ref=outind" target="_self">Python Operators</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-data-types/?ref=outind" target="_self">Python Data Types</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Python Loops and Control Flow</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python3-if-if-else-nested-if-if-elif-statements/?ref=outind" target="_self">Python Conditional Statements</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/loops-in-python/?ref=outind" target="_self">Python Loops</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-functions/?ref=outind" target="_self">Python Functions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-oops-concepts/?ref=outind" target="_self">Python OOPS Concept</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-data-structures-and-algorithms/?ref=outind" target="_self">Python Data Structures</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-exception-handling/?ref=outind" target="_self">Python Exception Handling</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/file-handling-python/?ref=outind" target="_self">Python File Handling</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-exercises-practice-questions-and-solutions/?ref=outind" target="_self">Python Exercises</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Java</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java/?ref=outind" target="_self">Learn Java Programming Language</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/collections-in-java-2/?ref=outind" target="_self">Java Collections</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-8-features/?ref=outind" target="_self">Java 8 Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-programming-examples/?ref=outind" target="_self">Java Programs</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Java Interview Questions</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-interview-questions/?ref=outind" target="_self">Java Interview Questions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/core-java-interview-questions-for-freshers/?ref=outind" target="_self">Core Java Interview Questions-Freshers</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/top-20-java-multithreading-interview-questions-answers/?ref=outind" target="_self">Java Multithreading Interview Questions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/oops-interview-questions/?ref=outind" target="_self">OOPs Interview Questions and Answers</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-exercises/?ref=outind" target="_self">Java Exercises</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Java Quiz</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/quizzes/50-java-language-mcqs-with-answers-2/?ref=outind" target="_self">Java Quiz</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-multiple-choice-questions/?ref=outind" target="_self">Core Java MCQ</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/java-projects/?ref=outind" target="_self">Java Projects</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Advance Java</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/spring/?ref=outind" target="_self">Spring Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/spring-boot/?ref=outind" target="_self">Spring Boot Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/spring-boot-interview-questions/?ref=outind" target="_self">Spring Boot Interview Questions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/spring-mvc/?ref=outind" target="_self">Spring MVC Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/spring-mvc-interview-questions/?ref=outind" target="_self">Spring MVC Interview Questions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/hibernate-tutorial/?ref=outind" target="_self">Hibernate Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/hibernate-interview-questions/?ref=outind" target="_self">Hibernate Interview Questions</a></li></ul></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Programming Languages</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/javascript/?ref=outind" target="_self">JavaScript</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/c-plus-plus/?ref=outind" target="_self">C++</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/r-tutorial/?ref=outind" target="_self">R Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/sql-tutorial/?ref=outind" target="_self">SQL</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/php-tutorial/?ref=outind" target="_self">PHP</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/csharp-programming-language/?ref=outind" target="_self">C#</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/c-programming-language/?ref=outind" target="_self">C</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/scala-programming-language/?ref=outind" target="_self">Scala</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/perl-programming-language/?ref=outind" target="_self">Perl</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/golang/?ref=outind" target="_self">Go Language</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/kotlin-programming-language/?ref=outind" target="_self">Kotlin</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>System Design</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/system-design-tutorial/?ref=ghm" target="_self">System Design Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/software-design-patterns/?ref=outind" target="_self">Software Design Patterns</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/complete-roadmap-to-learn-system-design/?ref=outind" target="_self">System Design Roadmap</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/top-10-system-design-interview-questions-and-answers/?ref=outind" target="_self">Top 10 System Design Interview Questions and Answers</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Interview Corner</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/company-preparation/?ref=outind" target="_self">Company Preparation</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/interview-preparation-for-software-developer/?ref=outind" target="_self">Top Topics</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://practice.geeksforgeeks.org/company-tags/?ref=outind" target="_self">Practice Company Questions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/company-interview-corner/?ref=outind" target="_self">Interview Experiences</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/experienced-interview-experiences-company-wise/?ref=outind" target="_self">Experienced Interviews</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/internship-interview-experiences-company-wise/?ref=outind" target="_self">Internship Interviews</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/competitive-programming-a-complete-guide/?ref=outind" target="_self">Competitive Programming</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/quiz-corner-gq/?ref=outind" target="_self">Multiple Choice Quizzes</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/aptitude-questions-and-answers/?ref=outind" target="_self">Aptitude for Placements</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Computer Science Subjects</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/operating-systems/?ref=outind" target="_self">Operating System</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/dbms/?ref=outind" target="_self">DBMS</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/computer-network-tutorials/?ref=outind" target="_self">Computer Networks</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/engineering-mathematics-tutorials/?ref=outind" target="_self">Engineering Mathematics</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/computer-organization-and-architecture-tutorials/?ref=outind" target="_self">Computer Organization and Architecture</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/theory-of-computation-automata-tutorials/?ref=outind" target="_self">Theory of Computation</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/compiler-design-tutorials/?ref=outind" target="_self">Compiler Design</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/digital-electronics-logic-design-tutorials/#blg/?ref=outind" target="_self">Digital Logic</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/software-engineering/?ref=outind" target="_self">Software Engineering</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>DevOps</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/git-tutorial/?ref=outind" target="_self">GIT</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/aws-tutorial/?ref=outind" target="_self">AWS</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/docker-tutorial/?ref=outind" target="_self">Docker</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/kubernetes-tutorial/?ref=outind" target="_self">Kubernetes</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/microsoft-azure/?ref=outind" target="_self">Microsoft Azure Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/google-cloud-platform-tutorial/?ref=outind" target="_self">Google Cloud Platform</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Linux</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/linux-tutorial/?ref=outind" target="_self">Linux Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/linux-commands/?ref=outind" target="_self">Linux Commands A-Z</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/linux-commands-cheat-sheet/?ref=outind" target="_self">Linux Commands Cheatsheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/permissions-in-linux/?ref=outind" target="_self">File Permission Commands</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/beginners-guide-to-linux-system-administration/?ref=outind" target="_self">Linux System Administration</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/linux-file-system/?ref=outind" target="_self">Linux File System</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-linux-shell-shell-scripting/?ref=outind" target="_self">Linux Shell Scripting</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/network-configuration-trouble-shooting-commands-linux/?ref=outind" target="_self">Linux Networking</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/linux-interview-questions/?ref=outind" target="_self">Linux Interview Questions</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Software Testing</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/software-testing-tutorial/?ref=outind" target="_self">Software Testing Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/software-engineering/?ref=outind" target="_self">Software Engineering Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/software-testing-interview-questions/?ref=outind" target="_self">Testing Interview Questions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/jira-tutorial/?ref=outind" target="_self">Jira</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Databases</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/dbms/?ref=outind" target="_self">DBMS Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/sql-tutorial/?ref=outind" target="_self">SQL Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/postgresql-tutorial/?ref=outind" target="_self">PostgreSQL Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/mongodb-tutorial/?ref=outind" target="_self">MongoDB Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/sql-interview-questions/?ref=outind" target="_self">SQL Interview Questions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/mysql-interview-questions/?ref=outind" target="_self">MySQL Interview Questions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/pl-sql-interview-questions/?ref=outind" target="_self">PL/SQL Interview Questions</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Android</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/android-tutorial/?ref=outind" target="_self">Android Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/android-studio-tutorial/?ref=outind" target="_self">Android Studio Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/kotlin-android-tutorial/?ref=outind" target="_self">Kotlin For Android</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/android-projects-from-basic-to-advanced-level/?ref=outind" target="_self">Android Projects</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/top-50-android-interview-questions-answers-sde-i-to-sde-iii/?ref=outind" target="_self">Android Interview Questions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/6-weeks-of-android-app-development-free-project-based-learning/?ref=outind" target="_self">6 Weeks of Android App Development</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Excel</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/excel-tutorial/?ref=outind" target="_self">MS Excel Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-ms-excel/?ref=outind" target="_self">Introduction to MS Excel</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/data-analysis-in-excel/?ref=outind" target="_self">Data Analysis in Excel</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/basic-excel-formulas-and-functions/?ref=outind" target="_self">Basic Excel Formulas & Functions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/instant-data-analysis-in-advanced-excel/?ref=outind" target="_self">Data Analysis in Advanced Excel</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/workbooks-in-microsoft-excel/?ref=outind" target="_self">Workbooks</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/statistical-functions-in-excel-with-examples/?ref=outind" target="_self">Statistical Functions</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/data-visualization-in-excel/?ref=outind" target="_self">Data Visualization in Excel</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/pivot-tables-in-excel/?ref=outind" target="_self">Pivot Tables in Excel</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/working-with-excel-spreadsheets-in-python/?ref=outind" target="_self">Excel Spreadsheets in Python</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/basic-excel-shortcuts/?ref=outind" target="_self">Basic Excel Shortcuts</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Mathematics</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/number-theory/?ref=outind" target="_self">Number System</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/algebra/?ref=outind" target="_self">Algebra</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/linear-algebra/?ref=outind" target="_self">Linear Algebra</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/math-trigonometry/?ref=outind" target="_self">Trigonometry</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/set-theory/?ref=outind" target="_self">Set Theory</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/statistics/?ref=outind" target="_self">Statistics</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/probability-in-maths/?ref=outind" target="_self">Probability</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/geometry/?ref=outind" target="_self">Geometry</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/mensuration/?ref=outind" target="_self">Mensuration</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/logarithms/?ref=outind" target="_self">Logarithms</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/math-calculus/?ref=outind" target="_self">Calculus</a></li></ul></li></ul></li><li class="header-main__list-item Header_3" data-parent="false" aria-expanded="true" data-expandable="true"><span>DSA</span><i class="gfg-icon gfg-icon_arrow-down gfg-icon_header"></i><ul class="mega-dropdown Screen_1"><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Data Structures</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/array-data-structure-guide/?ref=outind" target="_self">Arrays</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/matrix/?ref=outind" target="_self">Matrix</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/string-data-structure/?ref=outind" target="_self">Strings</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-linked-list-data-structure/?ref=ghm" target="_self">Linked List</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/stack-data-structure/?ref=outind" target="_self">Stack</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/queue-data-structure/?ref=outind" target="_self">Queue</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-tree-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Tree</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/heap-data-structure/?ref=outind" target="_self">Heap</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/hashing-data-structure/?ref=outind" target="_self">Hashing</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/graph-data-structure-and-algorithms/?ref=outind" target="_self">Graph</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-set-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Set Data Structure</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-map-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Map Data Structure</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/advanced-data-structures/?ref=outind" target="_self">Advanced Data Structure</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-data-structures/?ref=outind" target="_self">Data Structures Tutorial</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Algorithms</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Analysis of Algorithms</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/design-and-analysis-of-algorithms/?ref=outind" target="_self">Design and Analysis of Algorithms</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/asymptotic-notation-and-analysis-based-on-input-size-of-algorithms/?ref=outind" target="_self">Asymptotic Analysis</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/types-of-asymptotic-notations-in-complexity-analysis-of-algorithms/?ref=outind" target="_self">Asymptotic Notations</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/worst-average-and-best-case-analysis-of-algorithms/?ref=outind" target="_self">Worst, Average and Best Cases</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Searching Algorithms</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/linear-search/?ref=outind" target="_self">Linear Search</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/binary-search/?ref=outind" target="_self">Binary Search</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/searching-algorithms/?ref=outind" target="_self">Searching Algorithms Tutorial</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Sorting Algorithms</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/selection-sort/?ref=outind" target="_self">Selection Sort</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/bubble-sort/?ref=outind" target="_self">Bubble Sort</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/insertion-sort/?ref=outind" target="_self">Insertion Sort</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/merge-sort/?ref=outind" target="_self">Merge Sort</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/quick-sort/?ref=outind" target="_self">Quick Sort</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/heap-sort/?ref=outind" target="_self">Heap Sort</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/counting-sort/?ref=outind" target="_self">Counting Sort</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/radix-sort/?ref=outind" target="_self">Radix Sort</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/bucket-sort-2/?ref=outind" target="_self">Bucket Sort</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-sorting-algorithm/?ref=outind" target="_self">Sorting Algorithms Tutorial</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-greedy-algorithm-data-structures-and-algorithm-tutorials/?ref=outind" target="_self">Greedy Algorithms</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-dynamic-programming-data-structures-and-algorithm-tutorials/?ref=outind" target="_self">Dynamic Programming</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-graphs-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Graph Algorithms</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-pattern-searching-data-structure-and-algorithm-tutorial/?ref=outind" target="_self">Pattern Searching</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-recursion-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Recursion</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-backtracking-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Backtracking</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-divide-and-conquer-algorithm-data-structure-and-algorithm-tutorials/?ref=outind" target="_self">Divide and Conquer</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/mathematical-algorithms/?ref=outind" target="_self">Mathematical Algorithms</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/geometric-algorithms/?ref=outind" target="_self">Geometric Algorithms</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-bitwise-algorithms-data-structures-and-algorithms-tutorial/?ref=outind" target="_self">Bitwise Algorithms</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/randomized-algorithms/?ref=outind" target="_self">Randomized Algorithms</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-branch-and-bound-data-structures-and-algorithms-tutorial/?ref=outind" target="_self">Branch and Bound</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-algorithms/?ref=outind" target="_self">Algorithms Tutorial</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/learn-data-structures-and-algorithms-dsa-tutorial/?ref=outind" target="_self">DSA Tutorial</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Practice</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&sortBy=submissions&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">All DSA Problems</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/problem-of-the-day?itm_source=geeksforgeeksitm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Problem of the Day</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Company Wise Coding Practice</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&company=Amazon&sortBy=submissions&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Amazon</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&company=Microsoft&sortBy=submissions&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Microsoft</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&company=Flipkart&sortBy=submissions&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Flipkart</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&sortBy=submissions&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Explore All</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&curated[]=1&sortBy=submissions&curated_names[]=SDE Sheet?itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">GfG SDE Sheet</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Practice Problems Difficulty Wise</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&difficulty=School&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">School</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&difficulty=Basic&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Basic</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&difficulty=Easy&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Easy</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&difficulty=Medium&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Medium</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&difficulty=Hard&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Hard</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Language Wise Coding Practice</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&category=CPP&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">CPP</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&category=Java&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Java</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?category=python&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Python</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Curated DSA Lists</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&sprint=ca8ae412173dbd8346c26a0295d098fd&sortBy=submissions&sprint_name=Beginner's DSA Sheet&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Beginner's DSA Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&sprint=50746f92a895c22a50504ac0c1fb9c84&sortBy=submissions&sprint_name=Top 50 Array Problems&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Top 50 Array Problems</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&sprint=57184072610b884e5df3584cc534115d&sortBy=submissions&sprint_name=Top 50 String Problems&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Top 50 String Problems</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&sprint=93d672753b74440c7427214c8ebf866d&sortBy=submissions&sprint_name=Top 50 DP Problems&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Top 50 DP Problems</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&sprint=405e9db0f353691ad3b2d546b19145e9&sortBy=submissions&sprint_name=Top 50 Graph Problems&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Top 50 Graph Problems</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/explore?page=1&sprint=5f24de84b65bf7c4f4399c8111e26b81&sortBy=submissions&sprint_name=Top 50 Tree Problems&itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header" target="_self">Top 50 Tree Problems</a></li></ul></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/competitive-programming-a-complete-guide/?ref=outind" target="_self">Competitive Programming</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Company Wise SDE Sheets</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/facebookmeta-sde-sheet-interview-questions-and-answers/?ref=outind" target="_self">Facebook SDE Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/amazon-sde-sheet-interview-questions-and-answers/?ref=outind" target="_self">Amazon SDE Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/apple-sde-sheet-interview-questions-and-answers/?ref=outind" target="_self">Apple SDE Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/netflix-sde-sheet-interview-questions-and-answers/?ref=outind" target="_self">Netflix SDE Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/google-sde-sheet-interview-questions-and-answers/?ref=outind" target="_self">Google SDE Sheet</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>DSA Cheat Sheets</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/?ref=outind" target="_self">SDE Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/most-asked-dsa-interview-problems-for-beginners/?ref=outind" target="_self">DSA Sheet for Beginners</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/must-do-coding-questions-for-companies-like-amazon-microsoft-adobe/?ref=outind" target="_self">FAANG Coding Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/must-do-coding-questions-for-product-based-companies/?ref=outind" target="_self">Product-Based Coding Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/must-coding-questions-company-wise/?ref=outind" target="_self">Company-Wise Preparation Sheet</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/top-100-data-structure-and-algorithms-dsa-interview-questions-topic-wise/?ref=outind" target="_self">Top Interview Questions</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Puzzles</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/puzzles/?ref=outind" target="_self">All Puzzles</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/top-100-puzzles-asked-in-interviews/?ref=outind" target="_self">Top 100 Puzzles Asked In Interviews</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/top-20-puzzles-commonly-asked-during-sde-interviews/?ref=outind" target="_self">Top 20 Puzzles Commonly Asked During SDE Interviews</a></li></ul></li></ul></li><li class="header-main__list-item Header_4" data-parent="false" aria-expanded="true" data-expandable="true"><span>Data Science</span><i class="gfg-icon gfg-icon_arrow-down gfg-icon_header"></i><ul class="mega-dropdown Screen_1"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-programming-language/?ref=outind" target="_self">Python Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/r-tutorial/?ref=outind" target="_self">R Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/machine-learning/?ref=outind" target="_self">Machine Learning</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/data-science-with-python-tutorial/?ref=outind" target="_self">Data Science using Python</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/r-programming-for-data-science/?ref=outind" target="_self">Data Science using R</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Data Science Packages</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/pandas-tutorial/?ref=outind" target="_self">Pandas Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/numpy-tutorial/?ref=outind" target="_self">NumPy Tutorial</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Data Visualization</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/python-data-visualization-tutorial/?ref=outind" target="_self">Python Data Visualization Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/data-visualization-in-r/?ref=outind" target="_self">Data Visualization with R</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Data Analysis</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/data-analysis-with-python/?ref=outind" target="_self">Data Analysis with Python</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/data-analysis-using-r/?ref=outind" target="_self">Data Analysis with R</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/deep-learning-tutorial/?ref=outind" target="_self">Deep Learning</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/natural-language-processing-nlp-tutorial/?ref=outind" target="_self">NLP Tutorial</a></li></ul></li><li class="header-main__list-item Header_5" data-parent="false" aria-expanded="true" data-expandable="true"><span>Web Tech</span><i class="gfg-icon gfg-icon_arrow-down gfg-icon_header"></i><ul class="mega-dropdown Screen_1"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/html-tutorial/?ref=outind" target="_self">HTML Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/css-tutorial/?ref=outind" target="_self">CSS Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/javascript/?ref=outind" target="_self">JavaScript Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/php-tutorial/?ref=outind" target="_self">PHP Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/react-tutorial/?ref=outind" target="_self">ReactJS Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/nodejs/?ref=outind" target="_self">NodeJS Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/bootstrap/?ref=outind" target="_self">Bootstrap Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/typescript/?ref=outind" target="_self">Typescript</a></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Web Development Using Python</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Django</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/django-tutorial/?ref=outind" target="_self">Django Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/top-django-projects-for-beginners/?ref=outind" target="_self">Django Projects</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/django-interview-questions/?ref=outind" target="_self">Django Interview Questions</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Flask</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_3"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/flask-tutorial/?ref=outind" target="_self">Flask Tutorial</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/flask-projects/?ref=outind" target="_self">Flask Projects</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/flask-interview-questions-and-answers/?ref=outind" target="_self">Flask Interview Questions</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/postman-tutorial/?ref=outind" target="_self">Postman</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/introduction-to-github/?ref=outind" target="_self">Github</a></li></ul></li><li class="mega-dropdown__list-item" data-parent="false" aria-expanded="true" data-expandable="true"><span>Cheat Sheets</span><i class="gfg-icon gfg-icon_arrow-right"></i><ul class="mega-dropdown Screen_2"><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/html-cheat-sheet-a-basic-guide-to-html/?ref=outind" target="_self">HTML Cheat Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/css-cheat-sheet-a-basic-guide-to-css/?ref=outind" target="_self">CSS Cheat Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/javascript-cheat-sheet-a-basic-guide-to-javascript/?ref=outind" target="_self">JavaScript Cheat Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/react-cheat-sheet/?ref=outind" target="_self">React Cheat Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/angular-cheat-sheet-a-basic-guide-to-angular/?ref=outind" target="_self">Angular Cheat Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/jquery-cheat-sheet-a-basic-guide-to-jquery/?ref=outind" target="_self">jQuery Cheat Sheet</a></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/bootstrap-cheatsheet-a-basic-guide-to-bootstrap/?ref=outind" target="_self">Bootstrap Cheat Sheet</a></li></ul></li><li class="mega-dropdown__list-item" data-child="true" aria-expanded="false" data-expandable="false"><a href="https://www.geeksforgeeks.org/web-development/?ref=outind" target="_self">Learn Complete Web Development</a></li></ul></li></ul> <!-- right now only search is visible for mobile view because of css and all are visible for web view --> <ul class="header-main__left-list" data-nl="false"> <li class="header-main__left-list-item gcse-search_li p-relative" aria-expanded="false" data-expandable="false"> <div class="gcse-form-search-suggestion_wrapper"> <form id="gcse-form" class="gcse-form_class p-relative closeChatScreen" data-sm="false"> <span class="front-search-icon"><i class="gfg-icon gfg-icon_search gfg-icon_white gcse-search__icon gcse-search-icon_grey"></i> </span> <input class="gcse-search-input__wrapper" id="gcse-search-input" aria-expanded="false" placeholder="Search..." autocomplete="off" /> <i class="gfg-icon gfg-icon_times gfg-icon_white hide-search"></i> <button aria-label="search" type="submit" class="gcse-search__btn not-expanded"> <i class="gfg-icon gfg-icon_search gfg-icon_white gcse-search__icon"></i> </button> </form> <div class="gfg-search-suggestion_wrapper" style="display:none"></div> <div> </li> <li> <div class="darkMode-wrap" data-mode="Switch to Dark Mode"> <button aria-label="toggle theme" data-gfg-action="toggleGFGTheme"> <div id="darkMode-wrap-red-dot" style="height:12px;width:12px;background-color:#EB2222;border-radius:999999px;position:absolute;top:4px;right:0;display:none;"></div> <i class="gfg-icon gfg-icon_dark-mode"></i> </button> <span id="darkModeTooltipText"></span> </div> </li> <li class="header-main__left-list-item google-translate-parent-element" aria-expanded="false" data-expanded="true"> <div class="translate" id="g_translater"> <div id="google_translate_element" data-show="false"></div> </div> <i class ="gfg-icon gfg-icon_translate googleTranslateToggle" data-gfg-action="google_translate_element"></i> <!-- removed below code from here to load google translate js dynamically --> <!-- <script> var m = false; function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element'); setTimeout(function(){ if (jQuery( window ).width() < 768){ m = true; jQuery('#g_translater').detach().appendTo('#google_translate_mobile'); } }, 7000); } jQuery( window ).resize(function() { if (jQuery( window ).width() < 768 && m == false){ m = true; jQuery('#g_translater').detach().appendTo('#google_translate_mobile'); } else if (jQuery( window ).width() >= 768 && m == true){ m = false; jQuery('#g_translater').detach().prependTo('.google-translate-parent-element'); } }); </script> --> </li> <li id="userProfileId" class="header-main__left-list-item p-relative" aria-expanded="false" data-expandable="false"> <!-- Profile Section to be added via JS --> </li> </ul> </div> <!-- for mobile only --> <!-- for mobile only --> </div> </nav> <div class="header-main__slider"> <button aria-label="sub header slider previous" class="header-main__slider-arrow previous hideIt"> <i class="gfg-icon gfg-icon_arrow-left gicon-centered"></i> </button> <!-- main content for leftbar --> <ul id="hslider"> <li><a href="https://www.geeksforgeeks.org/maths/?ref=shm">Mathematics</a></li><li><a href="https://www.geeksforgeeks.org/number-theory/?ref=shm">Number System and Arithmetic</a></li><li><a href="https://www.geeksforgeeks.org/algebra/?ref=shm">Algebra</a></li><li><a href="https://www.geeksforgeeks.org/math-trigonometry/?ref=shm">Trigonometry</a></li><li><a href="https://www.geeksforgeeks.org/statistics/?ref=shm">Statistics</a></li><li><a href="https://www.geeksforgeeks.org/probability-in-maths/?ref=shm">Probability</a></li><li><a href="https://www.geeksforgeeks.org/geometry/?ref=shm">Geometry</a></li><li><a href="https://www.geeksforgeeks.org/mensuration/?ref=shm">Mensuration</a></li><li><a href="https://www.geeksforgeeks.org/math-calculus/?ref=shm">Calculus</a></li><li><a href="https://www.geeksforgeeks.org/logarithms/?ref=shm">Logarithms</a></li><li><a href="https://www.geeksforgeeks.org/basic-math-formulas/?ref=shm">Maths Formulas</a></li><li><a href="https://www.geeksforgeeks.org/integration-formulas/?ref=shm">Integration Formulas</a></li><li><a href="https://www.geeksforgeeks.org/differentiation-and-integration-formula/?ref=shm">Differentiation Formulas</a></li><li><a href="https://www.geeksforgeeks.org/trigonometry-formulas/?ref=shm">Trigonometry Formulas</a></li><li><a href="https://www.geeksforgeeks.org/algebra-formulas/?ref=shm">Algebra Formulas</a></li><li><a href="https://www.geeksforgeeks.org/mensuration-formulas/?ref=shm">Mensuration Formula</a></li><li><a href="https://www.geeksforgeeks.org/statistics-formulas/?ref=shm">Statistics Formulas</a></li><li><a href="https://www.geeksforgeeks.org/trigonometry-table/?ref=shm">Trigonometric Table</a></li> </ul> <button aria-label="sub header slider next" class="header-main__slider-arrow next hideIt"> <i class="gfg-icon gfg-icon_arrow-right gicon-centered"></i> </button> </div> <button id="scrollTopBtn" title="Scroll to Top" type="button" class="btn btn-success">▲</button> <!-- .top-spacing to give space on single pages--> <div id="main" class="wrapper single-page"> <script> if(post_slug.includes('premium-plans-payment/') || post_slug.includes('premium-plans/')){ $(".header-main__slider").remove(); } //getting tags for the page type data let mobileView = false; let pageTags = JSON.parse('null'); let allTags = JSON.parse('{"0":"Mathematics","1":"SchoolLearning","3":"MathsCategories","4":"Tutorials"}'); </script> <script> window.have_dsa_term = false; // var practiceTab = ; </script> <style> .wrapper { flex-direction: column !important; } /* spinner css */ @keyframes spinner { to {transform: rotate(360deg);} } .spinner:before { content: ''; box-sizing: border-box; position: absolute; top: 50%; left: 50%; width: 20px; height: 20px; margin-top: -10px; margin-left: -10px; border-radius: 50%; border: 2px solid #ccc; border-top-color: #000; animation: spinner .6s linear infinite; } .report-loader{ position: relative; } .report-loader.spinner{ margin-left: 16px; } .badges{ display: flex; align-items: center; position: relative; } .badges .gfg-badge-icon.md::after{ transform: scale(0.25); position:relative; top: 2px; left: -2px; } .sep{ margin: 0px 5px; font-size: 20px; color: var(--badge-name-color); } .pub-count{ font-size: 14px; font-family: var(--font-secondary); } .badge-details{ display:none; } .badges{ cursor: pointer; position: relative; /* width: 0px; height: 20px; top: -32px; */ } .badge-icon{ display: flex; align-items: center; } .badge-content{ margin-left: 9px; } .badge-name{ color: var(--badge-nam-color); font-weight: 600; font-size: 16px; text-transform: capitalize; } .badge-data{ color: #A5A4A4; font-size: 10px; } .badges:hover .badge-details{ display: block; background: var(--badge-bg); padding: 10px 18px 10px 18px; position: absolute; width: 175px; top: -10px; z-index: 10; left: 112%; box-shadow: rgb(100 100 111 / 20%) 0px 7px 29px 0px; border-radius: 5px; /* transform-origin: top right; */ } .badge-details::before { content: ""; position: absolute; transform: rotate(90deg); /* transform-origin: right; */ left: -6px; top: 50%; margin-left: -17px; border-width: 12px; border-style: solid; border-color: var(--badge-bg) transparent transparent transparent; margin-top: -12px; } .badge-icon .icon{ border: 1px solid var(--icon-border-color); padding: 4px 3px; border-radius: 4px; width: 22px; height: 24px; position: relative; } .b-icon-pos{ position: relative; top: -34px; left: -34px; } /* article viewer */ .article--viewer .a-wrapper{ margin-top: 0px !important; } .content{ padding-top: 10px !important; } .u-name{ font-size: 14px; } .article--viewer_content .a-wrapper .content{ padding-bottom: 10px !important; } .likeTooltipBottom{ font-size: 14px; } @media (max-width: 434px) { .article-buttons.show-bg{ margin-top: 56px !important; } } @media (max-width: 730px), ((min-width: 992px) and (max-width:1100px)) { .article--viewer .media{ position: relative; } .article--viewer .media{ margin-bottom: 0px !important; } .badges:hover .badge-details{ top: -56px; left: 62px; } .badge-details::before{ transform: rotate(0deg); left: 10%; top: 117%; } .article-buttons.show-bg{ margin-top: 22px; top: 0px !important; } } @media ((min-width:731px) and (max-width:1223px)) { .article-buttons.show-bg{ top: 18px; } } @media ((min-width:993px) and (max-width:1190px)) { .article--viewer .media{ position: relative; } .article--viewer .media{ margin-bottom: 25px !important; } } </style> <!-- Survey modal implementation --> <script> function getCookie(name) { function escape(s) { return s.replace(/([.*+?\^$(){}|\[\]\/\\])/g, '\\$1'); } var match = document.cookie.match(RegExp('(?:^|;\\s*)' + escape(name) + '=([^;]*)')); return match ? match[1] : null; } </script> <!-- END Survey modal implementation--> <!-- Open in App Button and CSS--> <!-- Above code is for old openInApp pop-up with open in app and continue buttons--> <div id='openInApp-modal' class='openInApp'> <a href = 'https://geeksforgeeksapp.page.link/?link=https://www.geeksforgeeks.org/number-theory/?type%3Darticle%26id%3D612013&apn=free.programming.programming&isi=1641848816&ibi=org.geeksforgeeks.GeeksforGeeksDev&efr=1' class='openInAppLink'> <span style='color: #fff;'>Open In App</span> </a> </div> <script> var consentValue = localStorage.getItem("gfg_cc"); var isIOS = !!navigator.platform && /iPad|iPhone|iPod|MacIntel/.test(navigator.platform) && navigator.maxTouchPoints > 0; const isSafari = navigator.userAgent.indexOf("Safari") > -1; const isMozilla = navigator.userAgent.indexOf("Mozilla") > -1; if(consentValue){ if(window.innerHeight > window.innerWidth && navigator.maxTouchPoints > 1 && (isSafari || isMozilla || navigator.userAgentData.mobile)){ $('.openInApp').css({ display: "block" }); $('#scrollTopBtn').css({ bottom: "44px" }); //adding a new class to check stats for clicks on iOS and Android isIOS ? jQuery('.openInAppLink').addClass("oia-iOS") : $('.openInAppLink').addClass("oia-android"); //for openInApp Link } } </script> <style> .openInApp{ display: none; bottom: 0px; width: 100%; position: fixed; z-index: 1025; opacity: 0.93; } .openInAppLink{ height: 44px; background: var(--color-gfg); font-weight: bold; display: block; text-align: center; padding: 12px; font-size: large; } .openInAppLink, .openInAppLink:hover, .openInAppLink:active, .openInAppLink:visited, .openInAppLink:focus { text-decoration:none; } </style> <!-- END Open in App Button and CSS--> <div class="container-fluid bg-light" id="home-page" style="position: relative; max-width:100%;"> <div class="article-page_flex"> <div class="sidebar_wrapper manual_leftbar "> <div class="sideBar " style="height: unset !important"> <!-- <div class="sideBar--wrap newLeftbar oinLeftbar "> --> <div class="sideBar--wrap newLeftbar "> <div id="GFG_AD_Leftsidebar_300x250_chained_1"></div> <div id="GFG_AD_Leftsidebar_300x250_chained_2"></div> <div id="GFG_AD_Leftsidebar_300x250_chained_3"></div> <div id="GFG_AD_Leftsidebar_300x600_chained_1"></div> </div> </div> <div id="GFG_AD_Desktop_LeftSideBar_Docked_160x600" style="max-width:160px; max-height:600px"></div> </div> <div class="leftBar"> <div class="article--viewer"> <div class="article--viewer_content"> <div class="a-wrapper"> <div class="" style="z-index:9999 !important;position:relative;"> </div> <article class="content post-612013 post type-post status-publish format-standard hentry category-maths category-school-learning tag-maths-categories tag-tutorials" id="post-612013"> <!-- when comment system will be scalable from practice side then we will display Article/Discussion tab--> <div class="main_wrapper" style="display:flex;"> <div style="width: 100%;"> <div class="article-title"> <h1>Number Theory in Mathematics</h1> </div> <div class="last_updated_parent"> <div> <span class="strong">Last Updated : </span> <span>31 Jul, 2024</span> </div> <!-- three dot menu --> <div class="three_dot_dropdown"> <div style="display: flex;"> <div pid="612013" ptitle="Number Theory in Mathematics" class="top-summary-icon-div "> <div class="three_dot_dropdown_div tooltip"> <span class="summary_tooltiptext">Summarize</span> <div class="summarize_header"> <i class= "summary_button" style="position: relative;"></i> </div> </div> </div> <div pid="612013" ptitle="Number Theory in Mathematics" class="article--viewer_comment tooltip top-comment-icon-div"> <span class="comment_tooltiptext">Comments</span> <div class="three_dot_dropdown_div" data-gfg-action='loadComments'> <div class="comment_header"> <i class= "discussion_button" style="position: relative; transform: scale(0.9);"></i> </div> </div> </div> <div pid="612013" ptitle="Number Theory in Mathematics" class="article--viewer_improve tooltip"> <span class="improve_tooltiptext">Improve</span> <div class="three_dot_dropdown_div three_dot_dropdown_improve" onclick="improveArticleCall()"> <div class="improve_wrapper_top"> <i class="gfg-icon gfg-icon-pencil gfg-icon_edit" style="position: relative; z-index: 3;"></i> </div> </div> <!-- <button onclick="improveArticleCall()"> <i class="gfg-icon gfg-icon_edit"></i> </button> --> </div> <!-- three dots --> <ul class="dropbtn icons btn-right showLeft" onclick="showDropdown()"> <li> </li> <li></li> <li></li> </ul> </div> </div> </div> </div> </div> <!-- menu --> <div id="myDropdown" class="three_dot_dropdown_content"> <div class="article-buttons drop" onmouseleave="closeKebabMenu()"> <!-- If the status of the summary API is true than we are showing the summarize button otherwise not --> <div pid="612013" ptitle="Number Theory in Mathematics" class="improve_article--viewer tooltip"> <div class="three_dot_dropdown_div three_dot_dropdown_improve" onclick="suggestionArticleCall()" style="margin-top: 1px;"> <div class="three_dot_dropdown_inner_div improve_dot_dropdown_inner_div"> <i class="gfg-icon gfg-icon_suggest_changes gfg-icon_edit"></i> <span>Suggest changes</span> </div> </div> </div> <div pid="612013" class="article--viewer_like tooltip"> <div class="three_dot_dropdown_div three_dot_dropdown_likearticle" onmouseleave='toggleLikeElementVisibility("showLikesContainer", false)' onmouseenter='toggleLikeElementVisibility("showLikesContainer", true)'> <div class="showLikesContainer"> <span class="likeTooltip">Like Article</span> </div> <div class="three_dot_dropdown_inner_div" data-gfg-action="like-article" data-bookmark-value="0"> <i class="gfg-icon gfg-icon_thumbs"></i> <span>Like</span> </div> </div> <!-- <button data-gfg-action="like-article" data-bookmark-value="0"> <i class="gfg-icon gfg-icon_thumbs"></i> </button> --> </div> <div pid="612013" class="article--viewer_bookmark tooltip"> <div class="three_dot_dropdown_div three_dot_dropdown_save"> <div class="three_dot_dropdown_inner_div" data-gfg-action="bookmark-article" data-bookmark-value="0"> <i class="gfg-icon gfg-icon_bookmark"></i> <span>Save</span> </div> </div> <!-- <button data-gfg-action="bookmark-article" data-bookmark-value="0"> <i class="gfg-icon gfg-icon_bookmark"></i> </button> --> </div> <div pid="612013" class="article--viewer_share tooltip"> <div class="three_dot_dropdown_div three_dot_dropdown_share" onmouseleave="closeShareModal()" onmouseenter="openShareModal()"> <div style="display: flex;align-items: center;" class="three_dot_dropdown_inner_div" data-gfg-action="share-article" data-bookmark-value="0"> <i class="gfg-share-icon"></i> <span>Share</span> </div> </div> </div> <div class="article--viewer_report tooltip"> <div class="three_dot_dropdown_div three_dot_dropdown_reportarticle"> <div class="three_dot_dropdown_inner_div" data-gfg-action="report-article" onclick="report_article();"> <i class="gfg-icon gfg-icon_report"></i> <span>Report</span> </div> </div> <!-- <button data-gfg-action="like-article" data-bookmark-value="0"> <i class="gfg-icon gfg-icon_thumbs"></i> </button> --> </div> <div class="article--viewer_Gnews tooltip"> <a class="three_dot_dropdown_inner_div Gnews_wrapper" href ='https://news.google.com/publications/CAAqBwgKMLTrzwsw44bnAw?hl=en-IN&gl=IN&ceid=IN%3Aen' target="_blank"> <img class="gfg-icon_Gnews no-zoom-in-cursor" src=https://media.geeksforgeeks.org/auth-dashboard-uploads/Google-news.svg loading="lazy" alt="News"></img> <span class='kebab_menu_news_text'>Follow</span> </a> </div> </div> </div> <div class="text"> <p dir="ltr" style="text-align: justify;"><b><strong>Number Theory</strong></b><span> is the branch of mathematics that deals with the study of positive numbers and arithmetic operations based on them. Numbers are the mathematical entities that are used for counting. Since the development of human civilization, numbers have always been a source of fascination for various mathematicians across the globe.</span></p> <p dir="ltr" style="text-align: justify;"><span>In this article on Number Theory, we will learn about </span><b><strong>what is number theory, the history of number theory, the number system, types of numbers, operations on numbers, arithmetic operations, and many more in detail.</strong></b></p><div id="GFG_AD_gfg_mobile_336x280" style="margin: 5px 0;"></div> <p dir="ltr" style="text-align: justify;"><img alt="Number Theory" height="inherit" src="https://media.geeksforgeeks.org/wp-content/uploads/20231005172352/Screenshot-from-2023-10-04-17-19-31-min.png" srcset="https://media.geeksforgeeks.org/wp-content/uploads/20231005172352/Screenshot-from-2023-10-04-17-19-31-min.png 991w,https://media.geeksforgeeks.org/wp-content/uploads/20231005172352/Screenshot-from-2023-10-04-17-19-31-min-100.png 100w,https://media.geeksforgeeks.org/wp-content/uploads/20231005172352/Screenshot-from-2023-10-04-17-19-31-min-200.png 200w,https://media.geeksforgeeks.org/wp-content/uploads/20231005172352/Screenshot-from-2023-10-04-17-19-31-min-300.png 300w,https://media.geeksforgeeks.org/wp-content/uploads/20231005172352/Screenshot-from-2023-10-04-17-19-31-min-660.png 660w,https://media.geeksforgeeks.org/wp-content/uploads/20231005172352/Screenshot-from-2023-10-04-17-19-31-min-768.png 768w" width="991"/></p> <div id="table_of_content"> <p style="margin:4px; font-size:20px; font-weight:bold;">Table of Content</p> <ul> <li><a href="#what-is-number-theory">What is Number Theory?</a></li> <li><a href="#history-of-number-theory">History of Number Theory</a></li> <li><a href="#branches-of-number-theory">Branches of Number Theory</a></li> <li><a href="#number-system">Number System</a></li> <li><a href="#types-of-number-system">Types of Number System</a></li> <li><a href="#what-is-arithmetic">What is Arithmetic?</a></li> <ul> <li><a href="#arithmetic-operations">Arithmetic Operations</a></li> <li><a href="#applications-of-arithmetic">Applications of Arithmetic</a></li> </ul> <li><a href="#properties-of-numbers">Properties of Numbers</a></li> <li><a href="#applications-of-number-theory">Applications of Number Theory</a></li> <li><a href="#number-theory-examples">Number Theory Examples </a></li> <li><a href="#number-thoery-books">Number Thoery Books</a></li> <li><a href="#practice-questions-on-number-theory">Practice Questions on Number Theory</a></li> </ul> </div> <h2 id="what-is-number-theory"><span>What is Number Theory?</span></h2> <p dir="ltr"><span>Number theory is a branch of mathematics that deals with the properties and relationships of numbers, particularly integers. It explores patterns, structures, and properties of numbers and seeks to understand their fundamental properties and behaviors.</span></p> <p dir="ltr"><span>Key topics in number theory include prime numbers, divisibility, modular arithmetic, Diophantine equations, and the distribution of prime numbers. Number theory has applications in various fields such as cryptography, computer science, and physics, and it plays a foundational role in many areas of mathematics.</span></p> <h2 id="history-of-number-theory"><span>History of Number Theory</span></h2> <p dir="ltr"><a href="https://www.geeksforgeeks.org/numbers/" rel="noopener" target="_blank"><span>Number </span></a><span>theory, originating in ancient Mesopotamia circa 1800 BC with Plimpton 322’s discovery, encompasses Pythagorean triplets and Babylonian astronomy.</span></p><div id="GFG_AD_Desktop_InContent_ATF_336x280" style="text-align:center; max-height: 280px;"></div><div id="GFG_AD_gfg_mobile_336x280_1" style="margin: 5px 0;"></div> <p dir="ltr"><span>Pythagoras furthered this with his triplets, influencing Euclid’s postulates in geometry and arithmetic. Indian mathematicians like Aryabhatta and Brahmagupta made key contributions, while the European Renaissance saw Pierre De Fermat’s perfect numbers and prime theory, and Leonhard Euler’s analytical number theory.</span></p><div id="_GFG_ABP_Incontent_728x90" style="text-align:center;"></div> <p dir="ltr"><span>Lagrange and Legendre refined prime number theory, and Carl Friedrich Gauss advanced quadratic reciprocity and computational methods. These efforts shaped modern number theory, impacting diverse mathematical fields and practical applications.</span></p> <h2 id="branches-of-number-theory"><span>Branches of Number Theory</span></h2> <p dir="ltr"><span>Number theory is vast and diverse, thus to understand it better it is classified into various sub branches given in the following table:</span></p> <table> <thead> <tr> <th><span>Branch</span></th> <th><span>Description</span></th> </tr> </thead> <tbody> <tr> <th><span>Elementary Number Theory</span></th> <td><span>Studies basic properties of integers like divisibility, primes, factorization, and congruences.</span></td> </tr> <tr> <th><span>Analytic Number Theory</span></th> <td><span>Applies tools from analysis to study the distribution of prime numbers and other number-theoretic functions.</span></td> </tr> <tr> <th><span>Algebraic Number Theory</span></th> <td><span>Investigates algebraic structures involving number fields, rings of integers, and algebraic integers.</span></td> </tr> <tr> <th><span>Diophantine Equations</span></th> <td><span>Focuses on finding integer solutions to polynomial equations, such as Fermat’s Last Theorem.</span></td> </tr> <tr> <th><span>Additive Number Theory</span></th> <td><span>Studies properties of additive structures within integers, including partitions and arithmetic progressions.</span></td> </tr> <tr> <th><span>Multiplicative Number Theory</span></th> <td><span>Focuses on multiplicative properties of integers, such as multiplicative functions and the distribution of primes.</span></td> </tr> </tbody> </table> <h2 id="number-system"><span>Number System</span></h2> <p dir="ltr"><span>The </span><a href="https://www.geeksforgeeks.org/number-system-in-maths/" rel="noopener"><b><strong>number system</strong></b></a><span> is a system for representing numbers on the Number Line in Number Theory using a collection of symbols and rules. These symbols, which run from 0 to 9, are referred to as digits. The </span><a href="https://www.geeksforgeeks.org/number-system-in-maths/" rel="noopener"><span>Number System </span></a><span>is used to conduct mathematical computations ranging from complex scientific calculations to simple counting of Toys for a Kid or the number of chocolates left in the box.</span></p> <h2 id="types-of-number-system"><span>Types of Number System</span></h2> <p dir="ltr"><span>Numbers can be written in different bases and various forms. The different </span><a href="https://www.geeksforgeeks.org/how-many-types-of-number-systems-are-there/" rel="noopener" target="_self"><span>types of number systems</span></a><span> are mentioned below:</span></p> <table> <thead> <tr> <th style="text-align: center;"><span>Number System</span></th> <th style="text-align: center;"><span>Description</span></th> </tr> </thead> <tbody> <tr> <th><span>Decimal Number System</span></th> <td><span>Base 10 representation using digits 0 to 9.</span></td> </tr> <tr> <th><span>Binary Number System</span></th> <td><span>Base 2 representation using digits 0 and 1.</span></td> </tr> <tr> <th><span>Octal Number System</span></th> <td><span>Base 8 representation using digits 0 to 7.</span></td> </tr> <tr> <th><span>Hexadecimal Number System</span></th> <td><span>Base 16 representation using digits 0 to 9 and letters A to F.</span></td> </tr> <tr> <th><span>Roman Number System</span></th> <td><span>Ancient system using letters: I (1), V (5), X (10), L (50), C (100), D (500), M (1000). Other numbers are represented using combinations of these letters.</span></td> </tr> </tbody> </table> <blockquote> <p dir="ltr"><b><strong>Note: </strong></b><span>We can also interconvert these numbers from one form to other form of number system.</span></p><div style="text-align:center;margin:20px 0; max-height: 280px;" id="GFG_AD_gfg_outstream_incontent"></div> </blockquote> <h3 id="articles-related-to-number-theory"><b><strong>Articles related to Number Theory:</strong></b></h3> <blockquote> <ul> <li value="1"><a href="https://www.geeksforgeeks.org/number-system-in-maths/" rel="noopener"><span>Number System</span></a></li> <li value="2"><a href="https://www.geeksforgeeks.org/binary-number-system-definition-conversion-examples/" rel="noopener"><span>Binary Numbers System</span></a></li> <li value="3"><a href="https://www.geeksforgeeks.org/decimal-vs-binary/" rel="noopener"><span>Decimal Number System vs Binary Number System</span></a></li> <li value="4"><a href="https://www.geeksforgeeks.org/roman-numerals/" rel="noopener"><span>Roman Numerals</span></a></li> </ul> </blockquote> <h3 id="types-of-numbers"><span>Types of Numbers</span></h3> <p dir="ltr"><span>Numbers are classified into various categories based on their properties. Let’s learn the various types of numbers.</span></p> <table> <thead> <tr> <th style="text-align: center;"><span>Type</span></th> <th style="text-align: center;"><span>Description</span></th> <th style="text-align: center;"><span>Examples</span></th> </tr> </thead> <tbody> <tr> <th><a href="https://www.geeksforgeeks.org/what-are-natural-numbers/" rel="noopener"><b><strong>Natural Numbers</strong></b></a></th> <td><span>Counting numbers starting from 1, denoted by N, including positive integers.</span></td> <td><span>1, 2, 3, 4, 5, . . .</span></td> </tr> <tr> <th><a href="https://www.geeksforgeeks.org/what-are-whole-numbers/" rel="noopener"><b><strong>Whole Numbers</strong></b></a></th> <td><span>Natural numbers including zero, denoted by W.</span></td> <td><span>0, 1, 2, 3, 4, . . .</span></td> </tr> <tr> <th><a href="https://www.geeksforgeeks.org/integers/" rel="noopener"><b><strong>Integers</strong></b></a></th> <td><span>Whole numbers along with their negatives and zero, denoted by Z.</span></td> <td><span>. . ., -3, -2, -1, 0, 1, 2, 3, . . .</span></td> </tr> <tr> <th><a href="https://www.geeksforgeeks.org/what-are-rational-numbers/" rel="noopener"><b><strong>Rational Numbers</strong></b></a></th> <td><span>Numbers expressible as a ratio of two integers, denoted by Q.</span></td> <td><span>1/2, 3/4. 7/3 . . .</span></td> </tr> <tr> <th><a href="https://www.geeksforgeeks.org/irrational-numbers/" rel="noopener"><b><strong>Irrational Numbers</strong></b></a></th> <td><span>Numbers that cannot be expressed as a ratio of two integers, often with non-repeating, non-terminating decimals.</span></td> <td><span>√2, </span><i><em class="GFGEditorTheme__textItalic">π</em></i><span>, </span><i><em class="GFGEditorTheme__textItalic">e</em></i><span>, . . .</span></td> </tr> <tr> <th><a href="https://www.geeksforgeeks.org/real-numbers/" rel="noopener"><b><strong>Real Numbers</strong></b></a></th> <td><span>Union of rational and irrational numbers, representing all points on the number line, denoted by R.</span></td> <td><span>-3.14, 0, 2.718, √3, . . .</span></td> </tr> <tr> <th><a href="https://www.geeksforgeeks.org/imaginary-numbers/" rel="noopener"><span>Imaginary Numbers</span></a></th> <td><span>Numbers of the form </span><i><em class="GFGEditorTheme__textItalic">bi</em></i><span>, where </span><i><em class="GFGEditorTheme__textItalic">b</em></i><span> is a non-zero real number and </span><i><em class="GFGEditorTheme__textItalic">i</em></i><span> is the imaginary unit.</span></td> <td><span>2</span><i><em class="GFGEditorTheme__textItalic">i</em></i><span>, −3</span><i><em class="GFGEditorTheme__textItalic">i</em></i><span>, 1/2</span><i><em class="GFGEditorTheme__textItalic">i</em></i><span>, . . .</span></td> </tr> <tr> <th><a href="https://www.geeksforgeeks.org/complex-numbers/" rel="noopener"><b><strong>Complex Numbers</strong></b></a></th> <td><span>Numbers of the form </span><i><em class="GFGEditorTheme__textItalic">a</em></i><span>+</span><i><em class="GFGEditorTheme__textItalic">bi</em></i><span>, where </span><i><em class="GFGEditorTheme__textItalic">a</em></i><span> and </span><i><em class="GFGEditorTheme__textItalic">b</em></i><span> are real numbers, and </span><i><em class="GFGEditorTheme__textItalic">i</em></i><span> is the imaginary unit, denoted by C.</span></td> <td><span>3+4</span><i><em class="GFGEditorTheme__textItalic">i</em></i><span>, 2−</span><i><em class="GFGEditorTheme__textItalic">i</em></i><span>, −1+2</span><i><em class="GFGEditorTheme__textItalic">i</em></i><span>, . . .</span></td> </tr> </tbody> </table> <h3 id="people-also-read"><b><strong>People Also Read:</strong></b></h3> <blockquote> <ul> <li value="1"><a href="https://www.geeksforgeeks.org/properties-of-real-numbers/" rel="noopener"><span>Properties of Real Numbers</span></a></li> <li value="2"><a href="https://www.geeksforgeeks.org/properties-of-rational-numbers/" rel="noopener"><span>Properties of Rational Numbers</span></a></li> </ul> </blockquote> <h3 id="numbers-based-on-divisibility"><span>Numbers based on Divisibility</span></h3> <p dir="ltr"><span>A number may be divisible by a certain number or may not be divisible a certain number. Hence based on divisibility they can be classified as follows:</span></p> <table> <thead> <tr> <th><span>Type</span></th> <th><span>Description</span></th> <th><span>Examples</span></th> </tr> </thead> <tbody> <tr> <th><a href="https://www.geeksforgeeks.org/prime-number/" rel="noopener"><span>Prime Numbers</span></a></th> <td><span>Natural numbers greater than 1 with no positive divisors other than 1 and itself.</span></td> <td><span>2, 3, 5, 7, 11, 13, 17, …</span></td> </tr> <tr> <th><a href="https://www.geeksforgeeks.org/composite-numbers/" rel="noopener"><span>Composite Numbers</span></a></th> <td><span>Natural numbers greater than 1 that are not prime, having divisors other than 1 and itself.</span></td> <td><span>4, 6, 8, 9, 10, 12, 14, …</span></td> </tr> <tr> <th><a href="https://www.geeksforgeeks.org/odd-numbers/" rel="noopener"><span>Odd Numbers</span></a></th> <td><span>Integers not divisible evenly by 2.</span></td> <td><span>-3, -1, 1, 3, 5, 7, …</span></td> </tr> <tr> <th><a href="https://www.geeksforgeeks.org/even-numbers/" rel="noopener"><span>Even Numbers</span></a></th> <td><span>Integers divisible evenly by 2.</span></td> <td><span>-4, -2, 0, 2, 4, 6, …</span></td> </tr> </tbody> </table> <h2 id="what-is-arithmetic"><span>What is Arithmetic?</span></h2> <p dir="ltr"><b><strong>Arithmetic</strong></b><span> is a field of mathematics that studies the characteristics of classical operations on numbers, such as addition, subtraction, multiplication, division, exponentiation, and root extraction.</span></p> <p dir="ltr"><span>Arithmetic is a fundamental aspect of number theory, which, along with algebra, geometry, and analysis, is regarded as one of the premieres of modern mathematics. The phrases arithmetic and higher arithmetic were used as synonyms for number theory until the early twentieth century, and are now occasionally used to refer to a wider section of number theory.</span></p> <p dir="ltr"><b><strong>Read More: </strong></b><a href="https://www.geeksforgeeks.org/math-arithmetic-what-is-arithmetic/" rel="noopener"><b><strong>Arithmetic</strong></b></a></p> <h3 id="arithmetic-operations"><span>Arithmetic Operations</span></h3> <p dir="ltr"><span>There are four basic arithmetic operations addition, subtraction, multiplication and division. These operations are helpful in daily life calculations as well as complex calculations. The four basic operations are discussed below:</span></p> <table> <thead> <tr> <th><span>Operation</span></th> <th><span>Description</span></th> <th><span>Symbol</span></th> <th><span>Example</span></th> </tr> </thead> <tbody> <tr> <th><span>Addition</span></th> <td><span>Combining two or more numbers to find their sum.</span></td> <td><span>+</span></td> <td><span>5 + 3=8</span></td> </tr> <tr> <th><span>Subtraction</span></th> <td><span>Finding the difference between two numbers.</span></td> <td><span>–</span></td> <td><span>9 − 4 = 5</span></td> </tr> <tr> <th><span>Multiplication</span></th> <td><span>Repeated addition; finding the product of two numbers.</span></td> <td><span>×, *</span></td> <td><span>2 × 6 = 12</span></td> </tr> <tr> <th><span>Division</span></th> <td><span>Sharing or partitioning a quantity into equal parts.</span></td> <td><span>÷, /</span></td> <td><span>12 ÷ 3 = 4</span></td> </tr> <tr> <th><span>Exponentiation</span></th> <td><span>Repeated multiplication; raising a number to a power.</span></td> <td><span>a</span><sup><span>b</span></sup></td> <td><span>2</span><sup><span>3 </span></sup><span>= 8</span></td> </tr> <tr> <th><span>Square Root</span></th> <td><span>Finding the number which, when multiplied by itself, gives the original number.</span></td> <td><span>√</span></td> <td><span>√(16) =4</span></td> </tr> </tbody> </table> <p dir="ltr"><b><strong>Related Articles:</strong></b></p> <blockquote> <ul> <li value="1"><a href="https://www.geeksforgeeks.org/multiplication-tables/" rel="noopener"><span>Multiplication Tables</span></a></li> <li value="2"><a href="https://www.geeksforgeeks.org/long-division/" rel="noopener"><span>Long Division Method</span></a></li> <li value="3"><a href="https://www.geeksforgeeks.org/operations-on-real-numbers/" rel="noopener"><span>Operation on Real Numbers</span></a></li> <li value="4"><a href="https://www.geeksforgeeks.org/rationalization-of-denominators/" rel="noopener"><span>Rationalization of Denominators</span></a></li> </ul> </blockquote> <h3 id="applications-of-arithmetic"><span>Applications of Arithmetic</span></h3> <p dir="ltr"><span>Arithmetic has got numerous applications in our daily lives. The above-discussed arithmetic operations are used to solve various types of arithmetic operations. Following are the related articles that define the applications of arithmetic.</span></p> <h3 id="people-also-read-1"><b><strong>People Also Read:</strong></b></h3> <blockquote> <ul> <li value="1"><a href="https://www.geeksforgeeks.org/ratio-and-proportion/" rel="noopener"><span>Ratio and Proportion</span></a></li> <li value="2"><a href="https://www.geeksforgeeks.org/percentage/" rel="noopener"><span>Percentages</span></a></li> <li value="3"><a href="https://www.geeksforgeeks.org/ratios-and-percentages/" rel="noopener"><span>Ratios and Percentages</span></a></li> <li value="4"><a href="https://www.geeksforgeeks.org/direct-and-inverse-proportions-class-8-maths/" rel="noopener"><span>Direct and Inverse Proportions</span></a></li> <li value="5"><a href="https://www.geeksforgeeks.org/percent-change-discounts-comparing-quantities-class-8-maths/" rel="noopener"><span>Percent Change & Discounts</span></a></li> <li value="6"><a href="https://www.geeksforgeeks.org/prices-related-to-buying-and-selling-profit-and-loss-comparing-quantities-class-8-maths/" rel="noopener"><span>Prices Related to Buying and Selling (Profit and Loss)</span></a></li> <li value="7"><a href="https://www.geeksforgeeks.org/compound-interest-class-8-maths/" rel="noopener"><span>Compound Interest</span></a><span> & </span><a href="https://www.geeksforgeeks.org/compound-interest-formula/" rel="noopener"><span>Compound Interest Formula</span></a></li> <li value="8"><a href="https://www.geeksforgeeks.org/sales-tax-value-added-tax-and-goods-and-services-tax-comparing-quantities-class-8-maths/" rel="noopener"><span>Sales Tax, Value Added Tax, and Goods and Services Tax</span></a></li> </ul> </blockquote> <h2 id="properties-of-numbers"><span>Properties of Numbers</span></h2> <p dir="ltr"><span>The numbers follow various properties. These properties are closure property, commutative property, associative property, distributive property, identity property, and inverse property. These properties are defined for different numbers and different operations.</span></p> <table> <thead> <tr> <th><span>Property</span></th> <th><span>Description</span></th> <th><span>Example</span></th> </tr> </thead> <tbody> <tr> <th><span>Closure Property</span></th> <td><span>The result of an operation on two numbers from a set is also a member of that set.</span></td> <td><span>Addition: 2+3=5 is a member of the set of integers.</span></td> </tr> <tr> <th><span>Commutative Property</span></th> <td><span>Changing the order of operands in an operation does not change the result.</span></td> <td><span>Addition: 2+3=3+2</span></td> </tr> <tr> <th><span>Associative Property</span></th> <td><span>Changing the grouping of operands in an operation does not change the result.</span></td> <td><span>Addition: (2+3)+4=2+(3+4)</span><br /><span>Multiplication: (2×3)×4=2×(3×4)</span></td> </tr> <tr> <th><span>Identity Property</span></th> <td><span>The result of an operation with a specific identity element and any number remains the same.</span></td> <td><span>Addition: 5 + 0 = 0 + 5=5</span></td> </tr> <tr> <th><span>Inverse Property</span></th> <td><span>For every element, there exists an inverse element such that their sum is the identity element.</span></td> <td><span>Addition: 5+(−5)=0</span></td> </tr> <tr> <th><span>Distributive Property</span></th> <td><span>The operation distributes over addition or subtraction.</span></td> <td><span>Multiplication over addition: 2×(3+4)=2×3+2×4</span></td> </tr> </tbody> </table> <p dir="ltr"><b><strong>Read More,</strong></b></p><div style="text-align:center;margin:20px 0;max-height:280px" id="GFG_AD_gfg_outstream_incontent-1"></div> <ul> <li value="1"><a href="https://www.geeksforgeeks.org/closure-property/" rel="noopener" target="_blank"><span>Closure Property</span></a></li> <li value="2"><a href="https://www.geeksforgeeks.org/commutative-property/" rel="noopener" target="_blank"><span>Commutative Property</span></a></li> <li value="3"><a href="https://www.geeksforgeeks.org/associative-property/" rel="noopener" target="_blank"><span>Associative Property</span></a></li> <li value="4"><a href="https://www.geeksforgeeks.org/distributive-property/" rel="noopener"><span>Distributive Property</span></a></li> </ul> <h2 id="applications-of-number-theory"><span>Applications of Number Theory</span></h2> <p dir="ltr"><span>Arithemtic has got wide range of applications in mathematics from finding the factors and multiples of a number to calculate the compounding value of money. Let’s learn the different applications of Arithmetic in brief.</span></p> <h3 id="place-value-and-face-value"><span>Place Value and Face Value</span></h3> <p dir="ltr"><span>Place Value and Face Value are important component a digit in a Number. Face Value is the the value by which a digit is recognised in mathematics irrespective of its position. For Example, in 5, 58, 568, the Face value of 5 is always five. However, the place value is the value of a digits due to its position. Place value is obtained by multiplying face value of number with its position. For example, in 5 the place value of 5 is 5 × 1 = 5 as 5 is in ones place. In 58, the place value of 5 is 5 × 10 = 50 as 5 is in tens place.</span></p> <p dir="ltr"><span>The place value also varies from indian system to international system. In Indian system the place value in increasing order is given as Ones, Tens, Hundred, Thousand, Ten Thousand, Lakh, Ten Lakh, Crore, Ten Crore etc.</span></p> <h3 id="factors-and-multiples"><b><strong>Factors and Multiples</strong></b></h3> <p dir="ltr"><span>A number is said to be a factor of other number if it divides other number exactly. The other number which gets divided is called Multiple. If the all the factors are prime, then the method is called Prime Factorization. Factors and Multiples has got application in Number Theory to find HCF and LCM of two or more numbers which are used in arithmetic Problems.</span></p> <blockquote> <ul> <li value="1"><a href="https://www.geeksforgeeks.org/hcf-and-lcm/" rel="noopener"><span>HCF and LCM</span></a></li> <li value="2"><a href="https://www.geeksforgeeks.org/fundamental-theorem-of-arithmetic/" rel="noopener"><span>Fundamental Theorem of Arithmetic</span></a></li> </ul> </blockquote> <h3 id="divisibility-rules"><span>Divisibility Rules</span></h3> <p dir="ltr"><a href="https://www.geeksforgeeks.org/divisibility-rules/" rel="noopener"><span>Divisibility Rules</span></a><span> are important to find with what numbers a number is divisible. Since, it is very difficult to divide and check if a given number is divisible by particular number or not, here divisibility rules comes as a saviour to make the calculation easy.</span></p> <h3 id="exponents"><b><strong>Exponents</strong></b></h3> <p dir="ltr"><span>In Theory of Numbers we come across numbers which are raised to some powers, for example, 2</span><sup><span>3</span></sup><span> where 2 is called the base and 3 is called the exponent. Exponents are used in Number Theory to represent very large numbers such as distance between two celestial bodies and also very small numbers such as mass of an atom. The problems involving exponents are solved using laws of exponents.</span></p> <blockquote> <ul> <li value="1"><a href="https://www.geeksforgeeks.org/what-are-the-7-laws-of-exponents/" rel="noopener"><span>Laws of Exponents</span></a></li> <li value="2"><a href="https://www.geeksforgeeks.org/negative-exponents/" rel="noopener"><span>Negative Exponents</span></a></li> </ul> </blockquote> <h3 id="roots"><b><strong>Roots</strong></b></h3> <p dir="ltr"><span>We know that exponents are the used to represent large numbers. But in case we have a large number which is a result of exponent raised to some base. This base is called Root of the Number. We often come across problems involving square root and cube root. To solve these questions we need to learn the concept of roots.</span></p> <blockquote> <ul> <li value="1"><a href="https://www.geeksforgeeks.org/nth-roots/" rel="noopener"><span>nth roots of a number</span></a></li> <li value="2"><a href="https://www.geeksforgeeks.org/squares-and-square-roots/" rel="noopener"><span>Squares and Square Roots</span></a></li> <li value="3"><a href="https://www.geeksforgeeks.org/cubes-and-cube-roots/" rel="noopener"><span>Cubes and Cube Roots</span></a></li> </ul> </blockquote> <h3 id="logarithms"><b><strong>Logarithms</strong></b></h3> <p dir="ltr"><span>In Number Theory, </span><a href="https://www.geeksforgeeks.org/logarithms/" rel="noopener"><span>Logarithm</span></a><span> is used to find the exponent for which a number is raised to give a certain certain result. For Example, 2</span><sup><span>3</span></sup><span> = 8, in this case, the base 2 can be find out using the concept of roots but the power to which 2 is raised to give 8 as result can be find out using the concept of logarithms. The reverse process of logarithm is called Antilog. Logarithm is valid only for positive numbers.</span></p> <blockquote> <ul> <li value="1"><a href="https://www.geeksforgeeks.org/logarithm-formula/" rel="noopener"><span>Log Formulas</span></a></li> <li value="2"><a href="https://www.geeksforgeeks.org/natural-log-formula/" rel="noopener"><span>Natural Log Formula</span></a></li> <li value="3"><a href="https://www.geeksforgeeks.org/laws-of-logarithms/" rel="noopener"><span>Laws of Logarithm</span></a></li> </ul> </blockquote> <h3 id="number-game"><span>Number Game</span></h3> <p dir="ltr"><span>A number game is any of a variety of puzzles and games that include mathematical concepts. Mathematical games and puzzles range from simple amusements to complex problems, some of which have never been solved. Arithmetic, algebra, number theory, group theory, combinatory (problems of configurations or designs), symbolic logic, can all be included. The origins of number games and mathematical recreations, as well as the values on which they are based, are covered in details, such as explanations of the puzzles, games, and recreations are discussed in the articles below:</span></p> <blockquote> <ul> <li value="1"><a href="https://www.geeksforgeeks.org/playing-with-numbers-class-8-maths/" rel="noopener"><span>Playing with Numbers</span></a></li> <li value="2"><a href="https://www.geeksforgeeks.org/game-of-numbers-playing-with-numbers-class-8-maths/" rel="noopener"><span>Game of Numbers</span></a></li> <li value="3"><a href="https://www.geeksforgeeks.org/letters-for-digits/" rel="noopener"><span>Letters for Digits</span></a></li> </ul> </blockquote> <h2 id="number-theory-examples"><span>Number Theory Examples </span></h2> <p dir="ltr"><b><strong>Example 1: Find the value of</strong></b></p><div style="text-align:center;margin:20px 0;max-height:280px" id="GFG_AD_gfg_outstream_incontent-2"></div> <p dir="ltr"><b><strong>i. 2</strong></b><b><sup><strong>3</strong></sup></b><b><strong> × 2</strong></b><b><sup><strong>5</strong></sup></b></p> <p dir="ltr"><b><strong>ii. (3/4)</strong></b><b><sup><strong>-2</strong></sup></b></p> <p dir="ltr"><b><strong>iii. (4</strong></b><b><sup><strong>3</strong></sup></b><b><strong>)</strong></b><b><sup><strong>2</strong></sup></b></p> <p dir="ltr"><b><strong>Solution:</strong></b></p> <blockquote> <p dir="ltr"><span>i. 2</span><sup><span>3</span></sup><span> × 2</span><sup><span>5</span></sup><span> = 2</span><sup><span>(3 + 5)</span></sup><span> = 2</span><sup><span>8</span></sup></p> <p dir="ltr"><span>ii. (3/4)</span><sup><span>-2</span></sup><span> = (4/3)</span><sup><span>2</span></sup><span> = 4</span><sup><span>2</span></sup><span>/3</span><sup><span>2</span></sup><span> = 16/9</span></p> <p dir="ltr"><span>iii. (4</span><sup><span>3</span></sup><span>)</span><sup><span>2</span></sup><span> = 4</span><sup><span>(3 × 2)</span></sup><span> = 4</span><sup><span>6</span></sup></p> </blockquote> <p dir="ltr"><b><strong>Example 2: Convert 25 into Binary</strong></b></p> <p dir="ltr"><b><strong>Solution:</strong></b></p> <blockquote> <p dir="ltr"><span>To convert 25 into binary we divide 25 successively by 2</span></p><div style="text-align:center;margin:20px 0;max-height:280px" id="GFG_AD_gfg_outstream_incontent-3"></div> <p dir="ltr"><span>25/2 gives Q = 12 and R = 1</span></p> <p dir="ltr"><span>12/2 Gives Q = 6 and R = 0</span></p> <p dir="ltr"><span>6/2 gives Q = 3 and R = 1</span></p> <p dir="ltr"><span>3/2 gives Q = 1 and R = 1</span></p> <p dir="ltr"><span>Now Q = 1 is not divisible by 2</span></p> <p dir="ltr"><span>Hence, the binary form of 25 is 11101</span></p> </blockquote> <p dir="ltr"><b><strong>Example 3: Find the square root of 576</strong></b></p> <p dir="ltr"><b><strong>Solution:</strong></b></p> <blockquote> <p dir="ltr"><span>We will find the prime factors of 576</span></p> <p><span>576 = 2 × 2 × 2 × 2 × 2 × 2 × 3 × 3</span></p> <p dir="ltr"><span>Therefore, square root of 576 = √576 = √(2 × 2 × 2 × 2 × 2 × 2 × 3 × 3)</span></p> <p dir="ltr"><span>Hence, √576 = √(2 × 2 × 2 × 2 × 2 × 2 × 3 × 3) = 2 × 2 × 2 × 3 = 24</span></p> </blockquote> <p dir="ltr"><b><strong>Example 4: If the HCF of two numbers is 4 and their LCM is 120 and one of the numbers is 8, find the other number</strong></b></p> <p dir="ltr"><b><strong>Solution:</strong></b></p> <blockquote> <p dir="ltr"><span>We know that Product of Two Numbers = Product of HCF and LCM</span></p> <p dir="ltr"><span>⇒ First Number × Second Number = HCF × LCM</span></p> <p dir="ltr"><span>⇒ 8 × Second Number = 4 × 120</span></p> <p dir="ltr"><span>Hence, Second Number = (4 × 120)/8 = 60</span></p> </blockquote> <p dir="ltr"><b><strong>Example 5: Solve log</strong></b><b><sub><strong>b</strong></sub></b><b><strong>5 + log</strong></b><b><sub><strong>b</strong></sub></b><b><strong>6</strong></b></p> <p dir="ltr"><b><strong>Solution:</strong></b></p><div style="text-align:center;margin:20px 0;max-height:280px" id="GFG_AD_gfg_outstream_incontent-4"></div> <blockquote> <p dir="ltr"><span>From Log Rules we know that log</span><sub><span>p</span></sub><span>x + log</span><sub><span>p</span></sub><span>y = log</span><sub><span>p</span></sub><span>(xy)</span></p> <p dir="ltr"><span>Hence, log</span><sub><span>b</span></sub><span>5 + log</span><sub><span>b</span></sub><span>6 = log</span><sub><span>b</span></sub><span>(5 × 6) = log</span><sub><span>b</span></sub><span>30</span></p> </blockquote> <p dir="ltr"><b><strong>Example 6: A boy scored 480 out of 500 marks in his board exams. Find the percentage of marks obtained by him.</strong></b></p> <p dir="ltr"><b><strong>Solution:</strong></b></p> <blockquote> <p dir="ltr"><span>Obtained Marks = 480</span></p> <p dir="ltr"><span>Full Marks = 500</span></p> <p dir="ltr"><span>Percentage of Marks = (480/500)×100 = 96%</span></p> </blockquote> <h2 id="number-thoery-books"><span>Number Thoery Books</span></h2> <ul> <li value="1"><b><strong>Elementary Number Theory by David M. Burton</strong></b></li> <li value="2"><b><strong>An Introduction to the Theory of Numbers by G.H. Hardy and E.M. Wright</strong></b></li> <li value="3"><b><strong>A Classical Introduction to Modern Number Theory by Kenneth Ireland and Michael Rosen</strong></b></li> <li value="4"><b><strong>Algebraic Number Theory by Jürgen Neukirch</strong></b></li> </ul> <h2 id="practice-questions-on-number-theory"><span>Practice Questions on Number Theory</span></h2> <p dir="ltr"><b><strong>Q1. Solve the following</strong></b></p> <ul> <li value="1"><b><strong>3</strong></b><b><sup><strong>4</strong></sup></b><b><strong> × 3</strong></b><b><sup><strong>5</strong></sup></b><b><strong> × 3</strong></b><b><sup><strong>6</strong></sup></b></li> <li value="2"><b><strong>4</strong></b><b><sup><strong>6</strong></sup></b><b><strong>/4</strong></b><b><sup><strong>5</strong></sup></b></li> <li value="3"><b><strong>2</strong></b><b><sup><strong>3</strong></sup></b><b><strong> × 3</strong></b><b><sup><strong>3</strong></sup></b></li> </ul> <p dir="ltr"><b><strong>Q2. Find the Prime Factors of Following Numbers</strong></b></p> <ul> <li value="1"><b><strong>236</strong></b></li> <li value="2"><b><strong>729</strong></b></li> <li value="3"><b><strong>150</strong></b></li> </ul> <p dir="ltr"><b><strong>Q3. A Man Purchased a Scooter for 45000 and then Sold it at a profit of 10%. Find the selling price of the scooter.</strong></b></p><div style="text-align:center;margin:20px 0;max-height:280px" id="GFG_AD_gfg_outstream_incontent-5"></div> <p dir="ltr"><b><strong>Q4. A man borrowed 2000 rupees for 3 years compound manually at the rate of 5% annually. Find the amount paid by him after 3 years.</strong></b></p> <p dir="ltr"><b><strong>Q5. Convert the following decimal numbers into binary equivalent</strong></b></p> <ul> <li value="1"><b><strong>112</strong></b></li> <li value="2"><b><strong>56</strong></b></li> <li value="3"><b><strong>65</strong></b></li> </ul> <p dir="ltr"><b><strong>Q6. Solve the following</strong></b></p> <ul> <li value="1"><b><strong>log</strong></b><b><sub><strong>c</strong></sub></b><b><strong>24 – log</strong></b><b><sub><strong>c</strong></sub></b><b><strong>12</strong></b></li> <li value="2"><b><strong>log</strong></b><b><sub><strong>10</strong></sub></b><b><strong>23</strong></b></li> </ul> <p dir="ltr"><b><strong>Q7. Find the HCF and LCM of following Numbers</strong></b></p> <ul> <li value="1"><b><strong>16 and 40</strong></b></li> <li value="2"><b><strong>25 and 300</strong></b></li> <li value="3"><b><strong>15 and 180</strong></b></li> </ul> <h2 id="faqs-on-number-theory"><span>FAQs on Number Theory</span></h2> <h3 id="what-is-number-theory-1"><span>What is Number Theory?</span></h3> <blockquote> <p dir="ltr"><span>Number Theory or Theory of Numbers is a branch of mathematics that deals with positive numbers and its applications.</span></p> </blockquote> <h3 id="who-are-credited-to-have-first-developed-the-number-theory"><span>Who are Credited to have First Developed the Number Theory?</span></h3> <blockquote> <p dir="ltr"><span>People of Babyloian Civilization are credited to have first developed the concept of Number Theory.</span></p> </blockquote> <h3 id="who-are-some-popular-number-theorists"><span>Who are some popular Number Theorists?</span></h3> <blockquote> <p dir="ltr"><span>Some of the popular Number Theorists include Pythagoras, Euclid, Fermat, Gauss, Aryanhatta, Brahmagupt and Ramanujan.</span></p> </blockquote> <h3 id="what-are-the-branches-of-number-theory"><span>What are the Branches of Number Theory?</span></h3> <blockquote> <p dir="ltr"><span>The different Branches of Number Theory are Elementary Number Theory, Algebraic Number Theory, AnalyticaL Number Theory and Dipohantine Number Theory.</span></p> </blockquote> <h3 id="what-is-pythagorean-triplet"><span>What is Pythagorean Triplet?</span></h3> <blockquote> <p dir="ltr"><span>Pythagorean Triplet is a collection of three numbers such that the square of the largest number is equal to the sum of the squares of the rest two numbers.</span></p> </blockquote> <h3 id="what-are-the-different-numbers-system-in-which-numbers-can-be-written"><span>What are the different Numbers System in which Numbers can be written?</span></h3> <blockquote> <p dir="ltr"><span>The different forms in which numbers can be written are Binary System, Decimal System, Octal System and Hexadecimal System.</span></p> </blockquote> <h3 id="what-is-hardy-ramanujan-number"><span>What is Hardy Ramanujan Number?</span></h3> <blockquote> <p dir="ltr"><span>1729 is known as Hardy Ramanujan Number as it can be represented as sum of cubes of two different pairs of number. 1729 = 12</span><sup><span>3</span></sup><span> + 1</span><sup><span>3</span></sup><span> and also 1729 = 10</span><sup><span>3</span></sup><span> + 9</span><sup><span>3</span></sup></p> </blockquote> <h3 id="which-is-the-only-even-prime-number"><span>Which is the only Even Prime Number?</span></h3> <blockquote> <p dir="ltr"><span>2 is the only even prime number.</span></p> </blockquote> <h3 id="what-is-bodmas"><span>What is BODMAS?</span></h3> <blockquote> <p dir="ltr"><a href="https://www.geeksforgeeks.org/bodmas-rule/" rel="noopener"><span>BODMAS</span></a><span> stands for Bracket, Of, Division, Multiplication, Addition and Subtraction. It is the order of priority to solving the operations where Bracket operations to be done first and subtraction to be done at last.</span></p> </blockquote> <h3 id="who-is-the-father-of-number-theory"><span>Who is the Father of Number Theory?</span></h3> <blockquote> <p dir="ltr"><span>Pierre de Fermat is regarded as the father of Number Theory.</span></p> </blockquote> <br/><div id="AP_G4GR_6"></div> <div class='article_bottom_text'></div><br> <div id="video-tab-content" class="video-tab-content"> <div style="text-align: center; margin: 20px 0px;" id="GFG_AD_InContent_Desktop_728x280"></div> </div> <div class="article-meta-author-details"> <div class="article-meta-author-details-block"> <div class="article-meta-author-details-profile-display"> <div class="article-meta-author-details-profile-display-icon"> <div class="image-wrap"> <img src= https://media.geeksforgeeks.org/wp-content/uploads/20200717172614/authPreLogo.png style="width:35px; height: 35px;border-radius: 25px;" class="avatarprofile_image restrict-popup-gfg" alt="https://media.geeksforgeeks.org/auth/avatar.png"> </div> </div> <div class="article-meta-author-details-profile-display-name" > <div class="info" style="position: unset;"> <div class="name"> <span style="color:#22A779; font-size: 16px; font-weight: 600">GeeksforGeeks</span> </div> </div> </div> </div> </div> <div class="article_bottom_suggestion_wrapper"> <div class="article_bottom_suggestion" data-title="Follow"> <a href='https://news.google.com/publications/CAAqBwgKMLTrzwsw44bnAw?hl=en-IN&gl=IN&ceid=IN%3Aen' target="_blank"> <img class="gfg-icon_Gnews no-zoom-in-cursor" src=https://media.geeksforgeeks.org/auth-dashboard-uploads/Google-news.svg loading="lazy" alt="News"></img> </a> </div> <div class='discussion_panel' data-title='Comments'> <i class='discussion_button' data-gfg-action='loadComments'> </i> </div> <div pid="612013" class="article--viewer_like tooltip tooltipBottom" data-title="Like Article"> <!-- <span class="tooltiptext likeTooltipBottom">Like Article</span> --> <button id="likeButton" aria-label="like article" data-gfg-action="like-article" data-bookmark-value="0" data-liked="false" style="color: #5B5A5A !important; display: flex; align-items: center; background-color: unset; margin: 0px !important; padding: 5px 0px;"> <i class="author-badge-like-button"></i> <figure id="likeCount" style="margin-left: 3px; margin-top: 4px; color: var(--like-count-color); font-size: 14px; font-weight: 600;" class="favoriteText"></figure> </button> </div> <div class="article_bottom_suggestion" onclick="improveArticleCall()" data-title="Improve"> <span class="improveTooltipBottom">Improve</span> <i class="author-badge-improvement-button"></i> </div> </div> </div> <div class="d-row content-bw "style="margin-top: 20px;"> <div class="article-pgnavi_prev"> </div> <div class="article-pgnavi_next"> <a href="https://www.geeksforgeeks.org/numbers/?ref=next_article" class="pg-head"> <span style="margin-right: 5px; margin-left: auto;">Next Article</span> <span class="gfg-icon gfg-icon_next"></span> </a> <!-- <div class="pg-meta">8 Min Read | <a href="#">Java</a></div> --> <div class="pg-main"> <a href="https://www.geeksforgeeks.org/numbers/?ref=next_article">What are Numbers?</a> </div> </div> </div> </div> </article> <div class="article--recommended article--recommended_wrapper" id="similar-reads"> <h3 class="new-top-bar top-bar-title">Similar Reads</h3> <div class="gfg-similar-reads-list"> <ul class="similarReadLeftBarList"><div class='second'><li class="currentpage similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/number-theory/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Number Theory in Mathematics </div> <div class="gfg-similar-read-item-subheading">Number Theory is the branch of mathematics that deals with the study of positive numbers and arithmetic operations based on them. Numbers are the mathematical entities that are used for counting. Since the development of human civilization, numbers have always been a source of fascination for variou</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">14 min read</span> </div> </a></li><div class="leftbar-dropdown"><h2 class="dropdown-title">Number System <span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/numbers/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">What are Numbers? </div> <div class="gfg-similar-read-item-subheading">Numbers in math are the most fundamental thing invented by mankind to serve its vast variety of endeavors in science and technology. From sending rockets to Mars to calculating bills for groceries, numbers are used everywhere. Nowadays, we can't think of mathematics without Understanding numbers. Th</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">15+ min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/number-system-in-maths/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Number System in Maths </div> <div class="gfg-similar-read-item-subheading">Number System is a method of representing numbers on the number line with the help of a set of Symbols and rules. These symbols range from 0-9 and are termed as digits. Let's learn about the number system in detail, including its types, and conversion. Number System in MathsNumber system in Maths is</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">13 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/real-numbers/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Real Numbers </div> <div class="gfg-similar-read-item-subheading">Real Numbers are continuous quantities that can represent a distance along a line, as Real numbers include both rational and irrational numbers. Rational numbers occupy the points at some finite distance and irrational numbers fill the gap between them, making them together to complete the real line</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">10 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/operations-on-real-numbers/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Operations on Real Numbers </div> <div class="gfg-similar-read-item-subheading">Real Numbers are those numbers that are a combination of rational numbers and irrational numbers in the number system of maths. Real Number Operations include all the arithmetic operations like addition, subtraction, multiplication, etc. that can be performed on these numbers. Besides, imaginary num</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">9 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/rational-numbers/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Rational Numbers </div> <div class="gfg-similar-read-item-subheading">Rational numbers are a fundamental concept in mathematics, defined as numbers that can be expressed as the ratio of two integers, where the denominator is not zero. Represented in the form p/q (with p and q being integers), rational numbers include fractions, whole numbers, and terminating or repea</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">15+ min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/decimal-expansions-of-rational-numbers/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Decimal Expansions of Rational Numbers </div> <div class="gfg-similar-read-item-subheading">Real numbers are simply the combination of rational and irrational numbers, in the number system. In general, all the arithmetic operations can be performed on these numbers and they can be represented in the number line, also. So in this article let's discuss some rational and irrational numbers an</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">6 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/representation-of-rational-numbers-on-the-number-line-class-8-maths/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Representation of Rational Numbers on the Number Line | Class 8 Maths </div> <div class="gfg-similar-read-item-subheading">Rational numbers are the integers p and q expressed in the form of p/q where q>0. Rational numbers can be positive, negative or even zero. Rational numbers can be depicted on the number line. The centre of the number line is called Origin (O). Positive rational numbers are illustrated on the righ</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">5 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/rational-numbers-between-two-rational-numbers-class-8-maths/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Rational Numbers Between Two Rational Numbers | Class 8 Maths </div> <div class="gfg-similar-read-item-subheading">Real numbers are categorized into rational and irrational numbers respectively. Given two integers p and q, a rational number is of the form p/q, where q > 0. A special case arises when q=1 and the rational number simply becomes an integer. Hence, all integers are rational numbers, equal to p. Th</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">6 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/decimal-expansion-of-real-numbers/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Decimal Expansion of Real Numbers </div> <div class="gfg-similar-read-item-subheading">The combination of a set of rational and irrational numbers is called real numbers. All the real numbers can be expressed on the number line. The numbers other than real numbers that cannot be represented on the number line are called imaginary numbers (unreal numbers). They are used to represent co</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">6 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/laws-of-exponents-for-real-numbers/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Laws of Exponents for Real Numbers </div> <div class="gfg-similar-read-item-subheading">Laws of Exponents are fundamental rules used in mathematics to simplify expressions involving exponents. These laws help in solving arithmetic problems efficiently by defining operations like multiplication, division, and more on exponents. In this article, we will discuss the laws of exponent for r</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">6 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/irrational-numbers/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Irrational Numbers- Definition, Examples, Symbol, Properties </div> <div class="gfg-similar-read-item-subheading">Irrational numbers are real numbers that cannot be expressed as fractions. Irrational Numbers can not be expressed in the form of p/q, where p and q are integers and q ≠ 0. They are non-recurring, non-terminating, and non-repeating decimals. Irrational numbers are real numbers but are different from</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">12 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/rationalization-of-denominators/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Rationalization of Denominators </div> <div class="gfg-similar-read-item-subheading">Rationalization of Denomintors is a method where we change the fraction with an irrational denominator into a fraction with a rational denominator. If there is an irrational or radical in the denominator the definition of rational number ceases to exist as we can't divide anything into irrational pa</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">8 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">Arithmetic<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/hcf-and-lcm/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">HCF / GCD and LCM - Definition, Formula, Full Form, Examples </div> <div class="gfg-similar-read-item-subheading">The Highest Common Factor (HCF), also known as the Greatest Common Divisor (GCD), and Lowest Common Multiple (LCM) are fundamental concepts in mathematics, especially in number theory and arithmetic. The full form of HCF is the Highest Common Factor while the full form of LCM is the Least Common Mul</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">11 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/fundamental-theorem-of-arithmetic/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Fundamental Theorem of Arithmetic </div> <div class="gfg-similar-read-item-subheading">The Fundamental Theorem of Arithmetic is a useful method to understand the prime factorization of any number. The factorization of any composite number can be uniquely written as a multiplication of prime numbers, regardless of the order in which the prime factors appear. The figures above represent</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">7 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/divisibility-rules/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Divisibility Rules </div> <div class="gfg-similar-read-item-subheading">Divisibility rules are some shortcuts for finding if an integer is divisible by a number without actually doing the whole division process. For example, let's suppose a boy has 531 chocolates, and he has to distribute them among his 9 friends. Dividing 531 by 9, we get no remainder, which means 531</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">12 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">Roots<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/n-th-root-number/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">N-th root of a number </div> <div class="gfg-similar-read-item-subheading">Given two numbers N and A, find N-th root of A. In mathematics, Nth root of a number A is a real number that gives A, when we raise it to integer power N. These roots are used in Number Theory and other advanced branches of mathematics. Refer Wiki page for more information. Examples: Input : A = 81</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">7 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/squares-and-square-roots/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Squares and Square Roots </div> <div class="gfg-similar-read-item-subheading">Squares and Square roots are highly used mathematical concepts which are used for various purposes. Squares are numbers produced by multiplying a number by itself. Conversely, the square root of a number is the value that, when multiplied by itself, results in the original number. Thus, squaring and</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">13 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/how-to-find-square-root-of-a-number/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">How to Find Square Root of a Number? </div> <div class="gfg-similar-read-item-subheading">In everyday situations, the challenge of calculating the square root of a number is faced. What if one doesn't have access to a calculator or any other gadget? It can be done with old-fashioned paper and pencil in a long-division style. Yes, there are a variety of ways to do so. Let's start with dis</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">13 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/cube-roots/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Cube Roots </div> <div class="gfg-similar-read-item-subheading">A cube root of a number a is a value b such that when multiplied by itself three times (i.e., [Tex]b \times b \times b[/Tex]), it equals a. Mathematically, this is expressed as: b3 = a, where a is the cube of b. Cube is a number that we get after multiplying a number 3 times by itself. For example,</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">7 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">Number Game<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/playing-with-numbers-class-8-maths/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Playing with Numbers </div> <div class="gfg-similar-read-item-subheading">Playing with Numbers: Numbers are the mathematical objects used to count, measure, and label. The original examples are the natural numbers 1, 2, 3, 4, and so forth. Numbers can be represented in language with number words. More universally, individual numbers can be represented by symbols, called n</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">11 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/game-of-numbers-playing-with-numbers-class-8-maths/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Game of Numbers - Playing with Numbers | Class 8 Maths </div> <div class="gfg-similar-read-item-subheading">We use numbers in our day-to-day life. We buy everything with money and measure its quantity with the help of Numbers only. Therefore Numbers play a very significant role in our life. The common Representation of a Number is as follows: The general form of a two-digit number is ab=(10 × a)+b Here ab</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">9 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/letters-for-digits/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Letters for Digits </div> <div class="gfg-similar-read-item-subheading">A number multiplied by 2 gives 60. What is that number? The number is 30. That number is not known; assume that number as a variable and what value to be assigned to that variable in order to get the result as 60. The variable is defined as an unknown quantity. No definite value and it keeps changin</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">8 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">Ratio, Fractions, and Percentages<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/ratios-and-percentages/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Ratios and Percentages </div> <div class="gfg-similar-read-item-subheading">Ratios and Percentages: Comparing quantities is easy, each of the quantities is defined to a specific standard and then the comparison between them takes place after that. Comparing quantities can be effectively done by bringing them to a certain standard and then comparing them related to that spec</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">7 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/direct-and-inverse-proportions/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Direct and Inverse Proportions </div> <div class="gfg-similar-read-item-subheading">Direct and Inverse Proportions is a mathematical concept which help us understanding how quantities are dependent on each other. Let's say if you drive faster you will reach your destination in less time, similarly if a laborer works for more hours he will earn more. Here we see that speed and time</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">13 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/discount-formula/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Discount Formula </div> <div class="gfg-similar-read-item-subheading">Discount in Mathematics is defined as the reduction in price of any service and product. Discount is offered by the business owner to easily and quickly sell their product or services. Giving discounts increases the sales of the business and helps the business retain its customer. Discount is always</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">9 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/prices-related-to-buying-and-selling-profit-and-loss-comparing-quantities-class-8-maths/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Prices Related to Buying and Selling (Profit and Loss) - Comparing Quantities | Class 8 Maths </div> <div class="gfg-similar-read-item-subheading">A Person can gain profit only if Selling Price > Cost Price. Also, a person generates loss when Selling Price < Cost Price. So let's understand each term in detail. Selling Price (S.P) Definition: The price at which a shopkeeper sells an item to a customer is known as the Selling price(S.P). F</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">6 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/compound-interest-formula/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Compound Interest Formula </div> <div class="gfg-similar-read-item-subheading">Compound Interest is the interest that is calculated against a loan or deposit amount in which interest is calculated for the principal as well as the previous interest earned. The common difference between compound and simple interest is that in compound interest, interest is calculated for the pri</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">15 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/sales-tax-value-added-tax-and-goods-and-services-tax-comparing-quantities-class-8-maths/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Sales Tax, Value Added Tax, and Goods and Services Tax - Comparing Quantities | Class 8 Maths </div> <div class="gfg-similar-read-item-subheading">Tax is a mandatory fee levied by the government to collect revenue for public works providing the best facilities and infrastructure. The first known Tax system was in Ancient Egypt around 3000–2800 BC, in First Dynasty of Egypt. The first form of taxation was corvée and tithe. In India, The Tax was</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">6 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li></ul></div><div class="leftbar-dropdown"><h2 class="dropdown-title">Exponents<span class="gfg-icon gfg-icon_arrow-down-thin"></span></h2><ul style="display: none;"><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/negative-exponents/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Negative Exponents </div> <div class="gfg-similar-read-item-subheading">Negative Exponents are the exponents with negative values. In other words, negative exponents are the reciprocal of the exponent with similar positive values, i.e. a-n (a negative exponent) can be understood as the reciprocal exponent as 1/an. For example, find the value of (1/2)-2 we can write this</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">7 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li><li class="similarReadDropdownItem"><a href="https://www.geeksforgeeks.org/laws-of-exponents-use-of-exponents-to-express-small-numbers-in-standard-form-exponents-and-powers-class-8-maths/?ref=lbp"><div class="gfg-similar-read-item-content"> <div class="gfg-similar-read-item-heading">Laws of Exponents: Exponents and Powers | Class 8 Maths </div> <div class="gfg-similar-read-item-subheading">It is known that numbers can be expressed as xn where 'x' is called "Base" and 'n' is called as "Exponent". In simple words, we can say that the Significance of the exponent is that it tells the number of times we need to multiply our base. There are certain Laws of exponents which will make the cal</div> </div> <div class="reading-time"> <i class="reading-time-icon" data-gfg-action="readingtime"></i> <span style="color: var(--recommendation-card-text-color);font-size: 14px;font-weight: 500;line-height: 17px;">8 min read</span> </div> </a><hr style="background:var(--gfg-selected-color); width:70%; margin: 0 auto;"></hr></li></ul></div></div></ul> </div> </div> <div class="bottom-wrap" style="padding: 0px 20px;margin-bottom: 10px;"> <div class="improved"> <div class="t-head">Article Tags : </div> <ul> <li style="border-radius: 25px;" class=""> <a href="https://www.geeksforgeeks.org/category/school-learning/maths/?ref=article_category">Mathematics</a> </li> <li style="border-radius: 25px;" class=""> <a href="https://www.geeksforgeeks.org/category/school-learning/?ref=article_category">School Learning</a> </li> <li style="border-radius: 25px;" class=""> <a href="https://www.geeksforgeeks.org/tag/maths-categories/?ref=article_tag">Maths-Categories</a> </li> <li style="border-radius: 25px;" class=""> <a href="https://www.geeksforgeeks.org/tag/tutorials/?ref=article_tag">Tutorials</a> </li> </ul> </div> </div> <div class="vote-wrap"> <div style="display:none;align-items:center;justify-content:center;width:100%;"> <button aria-label="like" data-type="like" class="vote-this" style="margin-right: 0; margin-left:0 ;"> <i class="gfg-icon gfg-icon_like favoriteIcon"></i> <span class="favoriteLike">Like</span> <figure class="favoriteText"></figure> </button> </div> </div> </div> <div class="article-meta"> <div class="bottom-wrap"> <div id="GFG_AD_InContent_Desktop_BTF_650x250" style="text-align:center;max-height: 300px;"></div> </div> <!-- end --> </div> </div> </div> </div> <div id="report_modal_content" class="report_modal_content" style="display:hidden;"></div> <div class="onopen-discussion-panel"> <div class="discussion-tab"> <div class="discussion_heading"> <div></div> <i class="gfg-icon close-tab-icon"></i> </div> <div class="discussion_content"> <div style="height:100%"> <div style="height:100%" id="comment-system"></div> </div> </div> </div> </div> <div class="rightBar" style="padding-right: 5px;"> <style> .article--container_content{ align-items: unset !important; } .sideBar { position: sticky !important; } .gfg-icon_switch::after { background-position: -40px -281px !important; } .gfg-icon_transaction::after { background-position: -40px -321px !important; } .header-main__profile.selected+.mega-dropdown{ width: 225px !important; } #courses-container .course-price{ display:none; } /* .side--container_wscard .card-content .content .meta:empty, .practiceBannerFromPlugin{ display:none !important; } */ .side--container_wscard .card-content .content .meta{ display:block !important; } .side--container_wscard .card-content .content .meta p{ background-color: rgba(254, 212, 91, 0.6); font-size: 10pt; font-weight: bold; display: inline-block; color: var(--color-black); margin-top: 15px; padding: 0px 5px; } #try-it{ display:initial !important; } #try-it .try-it-div{ line-height: 34px; } .gfg-icon_dark-mode::after { background-position: -40px -680px; } .side--container_wscard .head{ font-size: 14px !important; } .nineDot-menu, .gfg-icon_ndot{ display: none; } #text-15{ flex-direction: column; } .mtq_correct_marker, .mtq_wrong_marker{ display: none; } .sidebar_wrapper > :last-child{ margin: unset !important; margin-left: 5px !important; margin-top: 20px !important; top: 70px !important; } .darkMode-wrap{ bottom:1% !important; } #secondary .textwidget{ margin-left: auto; margin-right: 0; text-align: right; } #secondary .widget_text:last-child{ top: 70px !important; } @media(max-width:768px){ #scrollTopBtn{ display:none !important; } } .rightbar_loggedin_promo_cta{ display:flex; cursor:pointer; margin-bottom:20px; } </style> <div id="secondary" class="widget-area"> <div class='OINTechPromoRightBarBanner' id='rightBarSaleBanner' style='text-align:right; margin-bottom:5px;'><a href=https://www.geeksforgeeks.org/geeksforgeeks-premium-subscription?itm_source=geeksforgeeks&itm_medium=rightbar_oin&itm_campaign=premium><img src=https://media.geeksforgeeks.org/auth-dashboard-uploads/premium_oin_rbar_min.png alt='three90RightbarBannerImg' style='width:300px; height:250px;'></a></div> <!------------------------ text-15 (for Ads) ------------------------ --> <aside id="text-15" class="widget widget_text"> <div class="textwidget"> <div id="_GFG_ABP_Desktop_RightSideBar_ATF_300x600_2"></div> <div id="GFG_AD_Desktop_RightSideBar_ATF_300x250_2" style="min-width: 300px;margin-bottom:10px;"></div> <div id='GFG_AD_Desktop_RightSideBar_ATF_300x600' style='min-width: 300px; min-height: 600px;margin-bottom:10px;'></div> </div> </aside> <!------------------------ text-16 (For Ads)------------------------ --> <aside id="text-16" class="widget widget_text"> <div class="textwidget"> <div id="_GFG_ABP_Desktop_RightSideBar_MTF_300x600"></div> <div id='GFG_AD_Desktop_RightSideBar_MTF_300x250' style='min-width: 300px;'></div> <div id="_GFG_ABP_Desktop_RightSideBar_BTF_300x600"></div> <div id="_GFG_ABP_Desktop_RightSideBar_BTF_300x600_3"></div> </div> </aside> <!-- ---------------------- courses section ------------------------- --> <style>.right-bar-explore-more{ visibility: hidden; min-height: 230px;text-align:left;min-width:300px;max-width:300px; padding-left: 19px; padding-right: 25px; margin-top: 20px;} .right-bar-explore-more .title{text-align:left;font-size:20px; font-weight: 600; line-height: 22px; color:var(--em-heading);padding:14px 0;font-family:var(--font-primary)} .right-bar-explore-more .rightbar-sticky-ul {list-style: disc outside; padding-left: 17px;} .right-bar-explore-more li{font-size: 14px !important;font-weight: 400;line-height: 18px !important;color: var(--em-text);margin: 14px 0;font-family:var(--font-primary);} .right-bar-explore-more li::marker{color: var(--em-text) !important;} .right-bar-explore-more .rightbar-sticky-ul a{text-align:left !important; color: var(--em-text); display: block !important;} .right-bar-explore-more .rightbar-sticky-ul a:hover{text-decoration:underline;color:var(--em-link)!important;} .right-bar-explore-more hr {margin: 0;background-color: var(--tn-hr);} @media (max-width: 991px){ .right-bar-explore-more{ width: 85%; margin: auto; margin-top: 20px; max-width: unset; display: none !important; } #text-18 .textwidget{ width: 100%; } }</style> <script> var rightBarExploreMoreList = `<li style="color:var(--color-black)"><a href="https://www.geeksforgeeks.org/logic-gates/?ref=rightbar_explore" target="_blank" style="font-family:var(--font-primary)">Logic Gates - Definition, Types, Uses</a></li><li style="color:var(--color-black)"><a href="https://www.geeksforgeeks.org/software-and-its-types/?ref=rightbar_explore" target="_blank" style="font-family:var(--font-primary)">Software and its Types</a></li><li style="color:var(--color-black)"><a href="https://www.geeksforgeeks.org/bayes-theorem/?ref=rightbar_explore" target="_blank" style="font-family:var(--font-primary)">Bayes' Theorem</a></li><li style="color:var(--color-black)"><a href="https://www.geeksforgeeks.org/cloud-deployment-models/?ref=rightbar_explore" target="_blank" style="font-family:var(--font-primary)">Cloud Deployment Models</a></li><li style="color:var(--color-black)"><a href="https://www.geeksforgeeks.org/types-of-computers/?ref=rightbar_explore" target="_blank" style="font-family:var(--font-primary)">Types of Computers</a></li>` </script> <!-------------------------------- Text-18 (explore more section + ads) ---------------------------> <aside id="text-18" class="widget widget_text"> <div class="textwidget"> <div class="right-bar-explore-more" style="display:none;visibility: unset;"> <div class="title">Explore More</div> <ul class="rightbar-sticky-ul"></ul> </div> <div id='GFG_AD_Desktop_RightSideBar_BTF_Sticky_300x250' style='min-width: 300px;margin-bottom:10px'></div> <div id='GFG_AD_Desktop_RightSideBar_Docked_160x600' style='min-width: 160px;'></div><div id='GFG_AD_Desktop_RightSideBar_BTFdocked_300x600' style='min-width: 300px;'></div> </aside> <!-------------------------- Text -20 (For maintaining some CSS) ---------------------- --> <aside id="text-20" class="widget widget_text"> <div class="textwidget"> <!-- Please do not delete this div --> </div> </aside> </div> <div id="user-personal-note" style="display: none;"></div> </div> </div> <section class="disqus-section"> <div class="article-page_flex"> <div class="leftBar"> </div> </div> </section> </div> <div id="video-popup" style="display:none"></div> <link rel="stylesheet" href='https://www.geeksforgeeks.org/wp-content/themes/iconic-one/css/articleList.min.css?ver=1.7'> <script> $(document).ready(function() { var isfollowingApiCall = false; if ($('.follow-btn').length) { var articleRecommendedTop = $(".article--recommended").offset().top; var articleRecommendedBottom = articleRecommendedTop + $(".article--recommended").outerHeight(); $(window).scroll(function() { var top_of_element = $(".article--recommended").offset().top; var bottom_of_element = $(".article--recommended").offset().top + $(".article--recommended").outerHeight(); var bottom_of_screen = $(window).scrollTop() + $(window).innerHeight(); var top_of_screen = $(window).scrollTop(); if ((bottom_of_screen > top_of_element && top_of_screen < bottom_of_element) || (bottom_of_screen > articleRecommendedTop && top_of_screen < articleRecommendedBottom) || (top_of_screen > articleRecommendedBottom)) { if (!isfollowingApiCall) { isfollowingApiCall = true; setTimeout(function(){ if (loginData && loginData.isLoggedIn) { if (loginData.userName !== $('#followAuthor').val()) { is_following(); } else { $('.profileCard-profile-picture').css('background-color', '#E7E7E7'); } } else { $('.follow-btn').removeClass('hideIt'); } }, 3000); } } }); } $(".accordion-header").click(function() { var arrowIcon = $(this).find('.bottom-arrow-icon'); arrowIcon.toggleClass('rotate180'); }); }); window.isReportArticle = false; function report_article(){ if (!loginData || !loginData.isLoggedIn) { const loginModalButton = $('.login-modal-btn') if (loginModalButton.length) { loginModalButton.click(); } return; } if(!window.isReportArticle){ //to add loader $('.report-loader').addClass('spinner'); jQuery('#report_modal_content').load(gfgSiteUrl+'wp-content/themes/iconic-one/report-modal.php', { PRACTICE_API_URL: practiceAPIURL, PRACTICE_URL:practiceURL },function(responseTxt, statusTxt, xhr){ if(statusTxt == "error"){ alert("Error: " + xhr.status + ": " + xhr.statusText); } }); }else{ window.scrollTo({ top: 0, behavior: 'smooth' }); $("#report_modal_content").show(); } } function closeShareModal() { const shareOption = document.querySelector('[data-gfg-action="share-article"]'); shareOption.classList.remove("hover_share_menu"); let shareModal = document.querySelector(".hover__share-modal-container"); shareModal && shareModal.remove(); } function openShareModal() { closeShareModal(); // Remove existing modal if any let shareModal = document.querySelector(".three_dot_dropdown_share"); shareModal.appendChild(Object.assign(document.createElement("div"), { className: "hover__share-modal-container" })); document.querySelector(".hover__share-modal-container").append( Object.assign(document.createElement('div'), { className: "share__modal" }), ); document.querySelector(".share__modal").append(Object.assign(document.createElement('h1'), { className: "share__modal-heading" }, { textContent: "Share to" })); const socialOptions = ["LinkedIn", "WhatsApp", "Copy Link"]; socialOptions.forEach((socialOption) => { const socialContainer = Object.assign(document.createElement('div'), { className: "social__container" }); const icon = Object.assign(document.createElement("div"), { className: `share__icon share__${socialOption.split(" ").join("")}-icon` }); const socialText = Object.assign(document.createElement("span"), { className: "share__option-text" }, { textContent: `${socialOption}` }); const shareLink = (socialOption === "Copy Link") ? Object.assign(document.createElement('div'), { role: "button", className: "link-container CopyLink" }) : Object.assign(document.createElement('a'), { className: "link-container" }); if (socialOption === "LinkedIn") { shareLink.setAttribute('href', `https://www.linkedin.com/sharing/share-offsite/?url=${window.location.href}`); shareLink.setAttribute('target', '_blank'); } if (socialOption === "WhatsApp") { shareLink.setAttribute('href', `https://api.whatsapp.com/send?text=${window.location.href}`); shareLink.setAttribute('target', "_blank"); } shareLink.append(icon, socialText); socialContainer.append(shareLink); document.querySelector(".share__modal").appendChild(socialContainer); //adding copy url functionality if(socialOption === "Copy Link") { shareLink.addEventListener("click", function() { var tempInput = document.createElement("input"); tempInput.value = window.location.href; document.body.appendChild(tempInput); tempInput.select(); tempInput.setSelectionRange(0, 99999); // For mobile devices document.execCommand('copy'); document.body.removeChild(tempInput); this.querySelector(".share__option-text").textContent = "Copied" }) } }); document.querySelector(".hover__share-modal-container").addEventListener("mouseover", () => document.querySelector('[data-gfg-action="share-article"]').classList.add("hover_share_menu")); } function toggleLikeElementVisibility(selector, show) { document.querySelector(`.${selector}`).style.display = show ? "block" : "none"; } function closeKebabMenu(){ document.getElementById("myDropdown").classList.toggle("show"); } </script> <!-- Script for the new design of similar read --> <script> $(document).ready(function() { $("#showMoreTagsBtn").click(function() { $('.articles-hidden-tags').show(); $(this).hide(); }); $("#showMorePracticeTagsBtn").click(function() { $(".practice-tags li:nth-child(n+5)").show(); $(this).hide(); }); }); </script> <!-- Script end for similar read --> <style> .grecaptcha-badge { visibility: hidden !important; } .thank-you-message { height: 100%; display:flex; flex-direction: column; justify-content: center; align-items: center; } .thank-you-message-content { margin-top: 17px; font: 400 20px var(--font-secondary); color: var(--improve-modal-text); line-height: 180%; text-align: center; } .thank-you-message-content h2{ font-family: var(--font-secondary); } .all-footer-information{ width: 100% !important;; } .footer-wrapper_links-list{ margin-block-start: 0em !important; width: 16% !important; padding-inline-start: 18px !important; } .link-head{ margin-bottom: 0px; } @media only screen and (max-width:1340px) { .footer-wrapper_links-list{ overflow-wrap: break-word; } } @media screen and (min-width: 991px) { .all-footer-information{ padding-left:15px; } } @media only screen and (max-width:980px) { .footer-wrapper_branding-address{ padding-top: 10px; } } @media (max-width: 750px) { .thank-you-message-content{ font-size: 14px; line-height: 170%; } } /* CSS variable meant to handle the dark and light mode icon for three 90 event in header courses dropdown */ :root{ --three90headericon : url('https://media.geeksforgeeks.org/auth-dashboard-uploads/three90daylogocompressed.svg'); --three90headericonposition : 0px -40px; --three90leftbarimggrid : url('https://media.geeksforgeeks.org/auth-dashboard-uploads/three90leftbarspritecompressed.svg'); --three90leftbarimgposition : -5px -55px; --three90leftbarbgcolour : #b3abd0; } body[data-dark-mode="true"]{ --three90leftbarimgposition : -6px 1px; --three90headericonposition : 0px 0px; --three90leftbarbgcolour: #8c82b9; } .three90leftbarimg{ margin-left: -5px; height: 30px; background-image: var(--three90leftbarimggrid); background-repeat: no-repeat; background-position: var(--three90leftbarimgposition); background-size: 212px; } .courseTabShimmer{ position: absolute; height: 110%; width: 0; opacity: .7; -webkit-animation: courseShimmer 2s cubic-bezier(0,0,.07,.61) infinite; animation: courseShimmer 2s cubic-bezier(0,0,.07,.61) infinite; box-shadow: 0 0 25px 5px #dddcdc; -webkit-transform: rotate(90deg); transform: rotate(90deg); padding:0px !important; border:unset !important; } @keyframes courseShimmer{ 0% { left: 0; } 55% { left: 100%; } 99% { left: 110%; } } </style> </div><!-- #main .wrapper --> <div id="displayModal" class="modal fade" role="dialog"> <div class="modal-dialog"> <!-- <div class="upper-box"> <h3 style="font: normal normal bold 18px/31px var(--font-primary); color: var(--color-black);">Improve your Coding Skills with Practice</h3> <button class="upper-box-btn"><a style="color: white !important;" href="https://practice.geeksforgeeks.org/explore?page=1&sortBy=submissions&utm_source=gfg&utm_medium=search-bar&utm_campaign=practice-search">Try It!</a></button> </div> --> <div class="modal-content"> <div class="error-message"></div> <!-- <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" data-modal="displayModal">×</button> <h2 class="modal-title" id="dmTitle"></h2> </div> --> <div class="modal-body" id="dmBody"> <div id="modal-dm-content"></div> <div class="modal-overlay" aria-hidden=true> <span class="loader__animation"></span> </div> <!-- body --> </div> </div> </div> </div> <div id="displayModalBackdrop" class="backdrop"></div> <!-- Footer start --> <footer class="gfg-footer" id="gfg-footer"> <div class="footer-wrapper"> <div class="footer-wrapper_branding"> <a class="footer-wrapper_branding-anchor" aria-label="GeeksforGeeks Logo" href="https://www.geeksforgeeks.org/"> <img style="height: 32px; width: 230px; max-width: fit-content;" class="footer-wrapper_branding-nlogo" src="https://media.geeksforgeeks.org/auth-dashboard-uploads/gfgFooterLogo.png" alt="geeksforgeeks-footer-logo"/> </a> <div class="footer-wrapper_branding-address"> <div class="address_section"> <div class="address-icon-wrapper"> <i class="gfg-icon gfg-icon_pin"></i> <div class="address_div"> <div class="footer-address"> Corporate & Communications Address:- A-143, 9th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305) | Registered Address:- K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305 </div> </div> </div> </div> </div> <div class="footer-wrapper_branding-social"> <a href="https://www.facebook.com/geeksforgeeks.org/" rel="noopener noreferrer" aria-label="GeeksforGeeks Facebook" target="_blank"> <div class="facebook"></div> </a> <a href="https://www.instagram.com/geeks_for_geeks/" rel="noopener noreferrer" aria-label="GeeksforGeeks Instagram" target="_blank"> <div class="instagram"></div> </a> <a href="https://in.linkedin.com/company/geeksforgeeks" rel="noopener noreferrer" aria-label="GeeksforGeeks LinkedIn" target="_blank"> <div class="linkedin"></div> </a> <a href="https://twitter.com/geeksforgeeks" rel="noopener noreferrer" aria-label="GeeksforGeeks Twitter" target="_blank"> <div class="twitter"></div> </a> <a href="https://www.youtube.com/geeksforgeeksvideos" rel="noopener noreferrer" aria-label="GeeksforGeeks YouTube" target="_blank"> <div class="youtube"></div> </a> </div> <div class="footer-wrapper_branding-app"> <a aria-label="GeeksforGeeks App Link" href="https://geeksforgeeksapp.page.link/gfg-app" target="_blank" ><img src="https://media.geeksforgeeks.org/auth-dashboard-uploads/googleplay.png" alt="GFG App on Play Store" id="gplay" loading="lazy"></a> <a aria-label="GeeksforGeeks App Link" href="https://geeksforgeeksapp.page.link/gfg-app" target="_blank"><img src="https://media.geeksforgeeks.org/auth-dashboard-uploads/appstore.png" alt="GFG App on App Store" id="appstore" loading="lazy"></a> </div> </div> <div class="all-footer-information"> <div class="footer-wrapper_links" style="justify-content: space-between; text-align: -webkit-left;"><ul class="footer-wrapper_links-list" ><li>Company</li><li><a href=https://www.geeksforgeeks.org/about/?ref=outindfooter>About Us</a></li><li><a href=https://www.geeksforgeeks.org/legal/?ref=outindfooter>Legal</a></li><li><a href=https://www.geeksforgeeks.org/press-release/?ref=outindfooter>In Media</a></li><li><a href=https://www.geeksforgeeks.org/about/contact-us/?ref=outindfooter>Contact Us</a></li><li><a href=https://www.geeksforgeeks.org/advertise-with-us/?ref=outindfooter>Advertise with us</a></li><li><a href=https://www.geeksforgeeks.org/gfg-corporate-solution/?ref=outindfooter>GFG Corporate Solution</a></li><li><a href=https://www.geeksforgeeks.org/campus-training-program/?ref=outindfooter>Placement Training Program</a></li><li><a href=https://www.geeksforgeeks.org/community/?ref=outindfooter>GeeksforGeeks Community</a></li></ul><ul class="footer-wrapper_links-list" ><li><a class="link-head" href=https://www.geeksforgeeks.org/introduction-to-programming-languages/?ref=outindfooter>Languages</a></li><li><a href=https://www.geeksforgeeks.org/python-programming-language/?ref=outindfooter>Python</a></li><li><a href=https://www.geeksforgeeks.org/java/?ref=outindfooter>Java</a></li><li><a href=https://www.geeksforgeeks.org/c-plus-plus/?ref=outindfooter>C++</a></li><li><a href=https://www.geeksforgeeks.org/php-tutorials/?ref=outindfooter>PHP</a></li><li><a href=https://www.geeksforgeeks.org/golang/?ref=outindfooter>GoLang</a></li><li><a href=https://www.geeksforgeeks.org/sql-tutorial/?ref=outindfooter>SQL</a></li><li><a href=https://www.geeksforgeeks.org/r-tutorial/?ref=outindfooter>R Language</a></li><li><a href=https://www.geeksforgeeks.org/android-tutorial/?ref=outindfooter>Android Tutorial</a></li><li><a href=https://www.geeksforgeeks.org/geeksforgeeks-online-tutorials-free/?ref=outindfooter>Tutorials Archive</a></li></ul><ul class="footer-wrapper_links-list" ><li><a class="link-head" href=https://www.geeksforgeeks.org/learn-data-structures-and-algorithms-dsa-tutorial/?ref=outindfooter>DSA</a></li><li><a href=https://www.geeksforgeeks.org/data-structures/?ref=outindfooter>Data Structures</a></li><li><a href=https://www.geeksforgeeks.org/fundamentals-of-algorithms/?ref=outindfooter>Algorithms</a></li><li><a href=https://www.geeksforgeeks.org/complete-guide-to-dsa-for-beginners/?ref=outindfooter>DSA for Beginners</a></li><li><a href=https://www.geeksforgeeks.org/basic-coding-problems-in-dsa-for-beginners/?ref=outindfooter>Basic DSA Problems</a></li><li><a href=https://www.geeksforgeeks.org/complete-roadmap-to-learn-dsa-from-scratch/?ref=outindfooter>DSA Roadmap</a></li><li><a href=https://www.geeksforgeeks.org/top-100-data-structure-and-algorithms-dsa-interview-questions-topic-wise/?ref=outindfooter>Top 100 DSA Interview Problems</a></li><li><a href=https://www.geeksforgeeks.org/dsa-roadmap-for-beginner-to-advanced-by-sandeep-jain/?ref=outindfooter>DSA Roadmap by Sandeep Jain</a></li><li><a href=https://www.geeksforgeeks.org/geeksforgeeks-master-sheet-list-of-all-cheat-sheets/?ref=outindfooter>All Cheat Sheets</a></li></ul><ul class="footer-wrapper_links-list" ><li><a class="link-head" href=https://www.geeksforgeeks.org/ai-ml-ds/?ref=outindfooter>Data Science & ML</a></li><li><a href=https://www.geeksforgeeks.org/data-science-tutorial/?ref=outindfooter>Data Science With Python</a></li><li><a href=https://www.geeksforgeeks.org/data-science-for-beginners/?ref=outindfooter>Data Science For Beginner</a></li><li><a href=https://www.geeksforgeeks.org/machine-learning/?ref=outindfooter>Machine Learning</a></li><li><a href=https://www.geeksforgeeks.org/machine-learning-mathematics/?ref=outindfooter>ML Maths</a></li><li><a href=https://www.geeksforgeeks.org/python-data-visualization-tutorial/?ref=outindfooter>Data Visualisation</a></li><li><a href=https://www.geeksforgeeks.org/pandas-tutorial/?ref=outindfooter>Pandas</a></li><li><a href=https://www.geeksforgeeks.org/numpy-tutorial/?ref=outindfooter>NumPy</a></li><li><a href=https://www.geeksforgeeks.org/natural-language-processing-nlp-tutorial/?ref=outindfooter>NLP</a></li><li><a href=https://www.geeksforgeeks.org/deep-learning-tutorial/?ref=outindfooter>Deep Learning</a></li></ul><ul class="footer-wrapper_links-list" ><li><a class="link-head" href=https://www.geeksforgeeks.org/web-technology/?ref=outindfooter>Web Technologies</a></li><li><a href=https://www.geeksforgeeks.org/html/?ref=outindfooter>HTML</a></li><li><a href=https://www.geeksforgeeks.org/css/?ref=outindfooter>CSS</a></li><li><a href=https://www.geeksforgeeks.org/javascript/?ref=outindfooter>JavaScript</a></li><li><a href=https://www.geeksforgeeks.org/typescript/?ref=outindfooter>TypeScript</a></li><li><a href=https://www.geeksforgeeks.org/learn-reactjs/?ref=outindfooter>ReactJS</a></li><li><a href=https://www.geeksforgeeks.org/nextjs/?ref=outindfooter>NextJS</a></li><li><a href=https://www.geeksforgeeks.org/bootstrap/?ref=outindfooter>Bootstrap</a></li><li><a href=https://www.geeksforgeeks.org/web-design/?ref=outindfooter>Web Design</a></li></ul><ul class="footer-wrapper_links-list" ><li><a class="link-head" href=https://www.geeksforgeeks.org/python-programming-language/?ref=outindfooter>Python Tutorial</a></li><li><a href=https://www.geeksforgeeks.org/python-programming-examples/?ref=outindfooter>Python Programming Examples</a></li><li><a href=https://www.geeksforgeeks.org/python-projects-beginner-to-advanced/?ref=outindfooter>Python Projects</a></li><li><a href=https://www.geeksforgeeks.org/python-tkinter-tutorial/?ref=outindfooter>Python Tkinter</a></li><li><a href=https://www.geeksforgeeks.org/python-web-scraping-tutorial/?ref=outindfooter>Web Scraping</a></li><li><a href=https://www.geeksforgeeks.org/opencv-python-tutorial/?ref=outindfooter>OpenCV Tutorial</a></li><li><a href=https://www.geeksforgeeks.org/python-interview-questions/?ref=outindfooter>Python Interview Question</a></li><li><a href=https://www.geeksforgeeks.org/django-tutorial/?ref=outindfooter>Django</a></li></ul></div><div class="footer-wrapper_links" style="justify-content: space-between; text-align: -webkit-left;"><ul class="footer-wrapper_links-list" style="margin-block-start: 0em; width:16%; padding-inline-start: 18px;"><li>Computer Science</li><li><a href=https://www.geeksforgeeks.org/operating-systems/?ref=outindfooter>Operating Systems</a></li><li><a href=https://www.geeksforgeeks.org/computer-network-tutorials/?ref=outindfooter>Computer Network</a></li><li><a href=https://www.geeksforgeeks.org/dbms/?ref=outindfooter>Database Management System</a></li><li><a href=https://www.geeksforgeeks.org/software-engineering/?ref=outindfooter>Software Engineering</a></li><li><a href=https://www.geeksforgeeks.org/digital-electronics-logic-design-tutorials/?ref=outindfooter>Digital Logic Design</a></li><li><a href=https://www.geeksforgeeks.org/engineering-mathematics-tutorials/?ref=outindfooter>Engineering Maths</a></li><li><a href=https://www.geeksforgeeks.org/software-development/?ref=outindfooter>Software Development</a></li><li><a href=https://www.geeksforgeeks.org/software-testing-tutorial/?ref=outindfooter>Software Testing</a></li></ul><ul class="footer-wrapper_links-list" ><li><a class="link-head" href=https://www.geeksforgeeks.org/devops-tutorial/?ref=outindfooter>DevOps</a></li><li><a href=https://www.geeksforgeeks.org/git-tutorial/?ref=outindfooter>Git</a></li><li><a href=https://www.geeksforgeeks.org/linux-tutorial/?ref=outindfooter>Linux</a></li><li><a href=https://www.geeksforgeeks.org/aws-tutorial/?ref=outindfooter>AWS</a></li><li><a href=https://www.geeksforgeeks.org/docker-tutorial/?ref=outindfooter>Docker</a></li><li><a href=https://www.geeksforgeeks.org/kubernetes-tutorial/?ref=outindfooter>Kubernetes</a></li><li><a href=https://www.geeksforgeeks.org/microsoft-azure/?ref=outindfooter>Azure</a></li><li><a href=https://www.geeksforgeeks.org/google-cloud-platform-tutorial/?ref=outindfooter>GCP</a></li><li><a href=https://www.geeksforgeeks.org/devops-roadmap/?ref=outindfooter>DevOps Roadmap</a></li></ul><ul class="footer-wrapper_links-list" ><li><a class="link-head" href=https://www.geeksforgeeks.org/system-design-tutorial/?ref=outindfooter>System Design</a></li><li><a href=https://www.geeksforgeeks.org/what-is-high-level-design-learn-system-design/?ref=outindfooter>High Level Design</a></li><li><a href=https://www.geeksforgeeks.org/what-is-low-level-design-or-lld-learn-system-design/?ref=outindfooter>Low Level Design</a></li><li><a href=https://www.geeksforgeeks.org/unified-modeling-language-uml-introduction/?ref=outindfooter>UML Diagrams</a></li><li><a href=https://www.geeksforgeeks.org/system-design-interview-guide/?ref=outindfooter>Interview Guide</a></li><li><a href=https://www.geeksforgeeks.org/software-design-patterns/?ref=outindfooter>Design Patterns</a></li><li><a href=https://www.geeksforgeeks.org/object-oriented-analysis-and-design/?ref=outindfooter>OOAD</a></li><li><a href=https://www.geeksforgeeks.org/system-design-interview-bootcamp-guide/?ref=outindfooter>System Design Bootcamp</a></li><li><a href=https://www.geeksforgeeks.org/most-commonly-asked-system-design-interview-problems-questions/?ref=outindfooter>Interview Questions</a></li></ul><ul class="footer-wrapper_links-list" ><li><a class="link-head" href=https://www.geeksforgeeks.org/technical-interview-preparation/?ref=outindfooter>Inteview Preparation</a></li><li><a href=https://www.geeksforgeeks.org/competitive-programming-a-complete-guide/?ref=outindfooter>Competitive Programming</a></li><li><a href=https://www.geeksforgeeks.org/top-algorithms-and-data-structures-for-competitive-programming/?ref=outindfooter>Top DS or Algo for CP</a></li><li><a href=https://www.geeksforgeeks.org/company-wise-recruitment-process/?ref=outindfooter>Company-Wise Recruitment Process</a></li><li><a href=https://www.geeksforgeeks.org/company-preparation/?ref=outindfooter>Company-Wise Preparation</a></li><li><a href=https://www.geeksforgeeks.org/aptitude-questions-and-answers/?ref=outindfooter>Aptitude Preparation</a></li><li><a href=https://www.geeksforgeeks.org/puzzles/?ref=outindfooter>Puzzles</a></li></ul><ul class="footer-wrapper_links-list" ><li>School Subjects</li><li><a href=https://www.geeksforgeeks.org/maths/?ref=outindfooter>Mathematics</a></li><li><a href=https://www.geeksforgeeks.org/physics/?ref=outindfooter>Physics</a></li><li><a href=https://www.geeksforgeeks.org/chemistry/?ref=outindfooter>Chemistry</a></li><li><a href=https://www.geeksforgeeks.org/biology/?ref=outindfooter>Biology</a></li><li><a href=https://www.geeksforgeeks.org/social-science/?ref=outindfooter>Social Science</a></li><li><a href=https://www.geeksforgeeks.org/english-grammar/?ref=outindfooter>English Grammar</a></li><li><a href=https://www.geeksforgeeks.org/commerce/?ref=outindfooter>Commerce</a></li><li><a href=https://www.geeksforgeeks.org/tag/world-general-knowledge/?ref=outindfooter>World GK</a></li></ul><ul class="footer-wrapper_links-list" ><li><a class="link-head" href=https://www.geeksforgeeks.org/videos/?ref=outindfooter>GeeksforGeeks Videos</a></li><li><a href=https://www.geeksforgeeks.org/videos/category/sde-sheet/?ref=outindfooter>DSA</a></li><li><a href=https://www.geeksforgeeks.org/videos/category/python/?ref=outindfooter>Python</a></li><li><a href=https://www.geeksforgeeks.org/videos/category/java-w6y5f4/?ref=outindfooter>Java</a></li><li><a href=https://www.geeksforgeeks.org/videos/category/c/?ref=outindfooter>C++</a></li><li><a href=https://www.geeksforgeeks.org/videos/category/web-development/?ref=outindfooter>Web Development</a></li><li><a href=https://www.geeksforgeeks.org/videos/category/data-science/?ref=outindfooter>Data Science</a></li><li><a href=https://www.geeksforgeeks.org/videos/category/cs-subjects/?ref=outindfooter>CS Subjects</a></li></ul></div> </div> </div> <!-- Jobs Fair 2024 related CSS changes --> <style> :root{ --home-jobs-section-jf-logo: url('https://media.geeksforgeeks.org/auth-dashboard-uploads/JobFair2024Logo.svg'); } body[data-dark-mode="true"] { --home-jobs-section-jf-logo: url('https://media.geeksforgeeks.org/auth-dashboard-uploads/JobFair2024LogoDark.svg'); } .hp_job_section_jf_logo, .job-a-thon-jf-sticky-header-logo{ background: var(--home-jobs-section-jf-logo); height: 50px; background-repeat: no-repeat; width: 105px; background-size: 100px; } @keyframes challenge { 0%{ transform: scale(1); } 50%{ transform: scale(1.03); } 100%{ transform: scale(1); } } .job-a-thon-jf-sticky-header-logo{ height: 45px; } </style> <!-- ---------------------------------- --> <div class="footer-strip" > <div class="copyright"> <a href="https://www.geeksforgeeks.org/" rel="noopener noreferrer" target="_blank">@GeeksforGeeks, Sanchhaya Education Private Limited</a><span>, <a href="https://www.geeksforgeeks.org/copyright-information/">All rights reserved</a></span> </div> <div class="social-links"> </div> </div> </footer> </div><!-- #page --> <script type='text/javascript' src='https://www.geeksforgeeks.org/wp-includes/js/wp-embed.min.js?ver=4.9.8'></script> <!-- Cookie Consent Div--> <div class="cookie-consent hide-consent"> <span class="cookie-text"> We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our <a href="https://www.geeksforgeeks.org/cookie-policy/" target="_blank"><u>Cookie Policy</u></a> & <a href="https://www.geeksforgeeks.org/privacy-policy/" target="_blank"><u>Privacy Policy</u></a> </span> <button class="consent-btn"> Got It ! </button> </div> <!-- Cookie Consent Div ends --> <!--Light Box Div starts--> <div class="lightbox-target"> <img id="lightbox-image" src="" alt="Lightbox"/> <span class="lightbox-close"></span> </div> <!--Light Box Div ends--> <!-- <link rel="stylesheet" href="https://use.typekit.net/mrg0hpc.css"/> --> <link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&family=Source+Sans+3:wght@400;600&display=swap" rel="stylesheet"> <script> if(post_slug.includes('premium-plans-payment/') || post_slug.includes('premium-plans/')){ $('.darkMode-wrap').remove(); $('.toggle-darkMode').remove(); } function setGoogleRecaptcha() { var captchaSiteKey = '6LdMFNUZAAAAAIuRtzg0piOT-qXCbDF-iQiUi9KY'; grecaptcha.ready(function() { grecaptcha.execute(captchaSiteKey).then(function(token) { document.getElementById('g-recaptcha-response-suggestion-form').value = token; suggestionCall(); }); }); } </script> <div class="improve-modal--overlay" style="display: none;"> <div class="improve-modal--improvement" status="locked"> <div class="improve-modal--improve-header"> <div class="improve-header-fst-child">Improvement</div> <div class="improve-header-sec-child"> <i class="gfg-icon improve-cross-icon"></i> </div> </div> <div class="locked-status--impove-modal"> <div class="improve-modal--improve-content error-message"></div> <div class="improve-modal--improve-bottom"> <button class="improve-bottom-btn" type="button">Suggest changes</button> </div> </div> <div class="unlocked-status--improve-modal-content"> <div class="suggest-change_wrapper"> <div class="suggest-change-content_wrapper"> <div class="suggest-change">Suggest Changes</div> <div class="suggest-changes-about">Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.</div> </div> <div class="suggest-change-icon_wrapper"> <img class="suggest-change-icon" src="https://media.geeksforgeeks.org/auth-dashboard-uploads/suggestChangeIcon.png" alt="geeksforgeeks-suggest-icon"/> </div> </div> <div class="create-improvement_wrapper"> <div class="create-improvement-content_wrapper"> <div class="create-improvement">Create Improvement</div> <div class="create-improvements-about">Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.</div> </div> <div class="create-improvement-icon_wrapper"> <img class="create-improvement-icon" src="https://media.geeksforgeeks.org/auth-dashboard-uploads/createImprovementIcon.png" alt="geeksforgeeks-improvement-icon"/> </div> </div> <div class="error-status"></div> </div> </div> <div class="improve-modal--suggestion" style="display: none;"> <!-- Header of improve-modal--improvement and improve-modal--suggestion have same CSS rule that's why I use same class name --> <div class="improve-modal--improve-header"> <div class="left-arrow-icon_suggest_wrapper"> <div class="left-arrow-icon_wrapper"> <i class="gfg-icon improve-left-arrow-icon"></i> </div> <div class="improve-header-fst-child">Suggest Changes</div> </div> <div class="improve-header-sec-child"> <i class="gfg-icon improve-cross-icon"></i> </div> </div> <div class="suggestion-modal-section"> <form> <label for="suggestion-section">min 4 words, max CharLimit:2000</label> <textarea id="suggestion-section-textarea" name="suggestion-section" placeholder="Write your suggestions here"></textarea> <input type="hidden" name="g-recaptcha-suggestion-response" id="g-recaptcha-response-suggestion-form"> </form> </div> <!-- Button of improve-modal--improvement and improve-modal--suggestion have same CSS rule that's why I use same class name --> <div class="improve-modal--improve-bottom suggestion-btn"> <p><span id="suggestion-modal-alert" style="display: none;"></span></p> <button class="suggest-bottom-btn" type="button"></button> </div> </div> <a href="#" style="visibility:hidden" class="create-improvement-redirection-to-write" target="_blank"></a> </div> <script> var lockedCasesHtml = `<span class="improve-modal--improve-content-modified"></span><span>You can suggest the changes for now and it will be under 'My Suggestions' Tab on Write.</span><br><br><span>You will be notified via email once the article is available for improvement. Thank you for your valuable feedback!</span>`; var badgesRequiredHtml = `<span>It seems that you do not meet the eligibility criteria to create improvements for this article, as only users who have earned specific badges are permitted to do so.</span><br><br><span>However, you can still create improvements through the <a href="https://write.geeksforgeeks.org/pick-improvements/pick" target='_blank'>Pick for Improvement</a> section.</span>`; jQuery('.improve-header-sec-child').on('click', function(){ jQuery('.improve-modal--overlay').hide(); $('.improve-modal--suggestion').hide(); }); $('.suggest-change_wrapper, .locked-status--impove-modal .improve-bottom-btn').on('click',function(){ // when suggest changes option is clicked $('#suggestion-section-textarea').val(""); $('.suggest-bottom-btn').html("Suggest changes"); $('.improve-modal--improvement').hide(); $('.improve-modal--suggestion').show(); }); $('.create-improvement_wrapper').on('click',function(){ // when create improvement option clicked then improvement reason will be shown if(loginData && loginData.isLoggedIn) { $('body').append('<div class="spinner-loading-overlay"></div>'); $('.spinner-loading-overlay').show(); jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id }), success:function(result) { $('.spinner-loading-overlay:eq(0)').remove(); $('.improve-modal--overlay').hide(); $('.unlocked-status--improve-modal-content').css("display","none"); $('.create-improvement-redirection-to-write').attr('href',writeUrl + 'improve-post/' + `${result.id}` + '/', '_blank'); $('.create-improvement-redirection-to-write')[0].click(); }, error:function(e) { showErrorMessage(e.responseJSON,e.status) }, }); } else { if(loginData && !loginData.isLoggedIn) { $('.improve-modal--overlay').hide(); if ($('.header-main__wrapper').find('.header-main__signup.login-modal-btn').length) { $('.header-main__wrapper').find('.header-main__signup.login-modal-btn').click(); } return; } } }); $('.left-arrow-icon_wrapper').on('click',function(){ if($('.improve-modal--suggestion').is(":visible")) $('.improve-modal--suggestion').hide(); else{ } $('.improve-modal--improvement').show(); }); const showErrorMessage = (result,statusCode) => { if(!result) return; $('.spinner-loading-overlay:eq(0)').remove(); if(statusCode == 403) { $('.improve-modal--improve-content.error-message').html(result.message); jQuery('.improve-modal--overlay').show(); jQuery('.improve-modal--improvement').show(); $('.locked-status--impove-modal').css("display","block"); $('.unlocked-status--improve-modal-content').css("display","none"); $('.improve-modal--improvement').attr("status","locked"); return; } } function loadScript(src, callback) { var script = document.createElement('script'); script.src = src; script.onload = callback; document.head.appendChild(script); } function suggestionCall() { var suggest_val = $.trim($("#suggestion-section-textarea").val()); var array_String= suggest_val.split(" ") var gCaptchaToken = $("#g-recaptcha-response-suggestion-form").val(); var error_msg = false; if(suggest_val != "" && array_String.length >=4){ if(suggest_val.length <= 2000){ var payload = { "gfg_post_id" : `${post_id}`, "suggestion" : `<p>${suggest_val}</p>`, } if(!loginData || !loginData.isLoggedIn) // User is not logged in payload["g-recaptcha-token"] = gCaptchaToken jQuery.ajax({ type:'post', url: "https://apiwrite.geeksforgeeks.org/suggestions/auth/create/", xhrFields: { withCredentials: true }, crossDomain: true, contentType:'application/json', data: JSON.stringify(payload), success:function(data) { jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-section-textarea').val(""); jQuery('.suggest-bottom-btn').css("display","none"); // Update the modal content const modalSection = document.querySelector('.suggestion-modal-section'); modalSection.innerHTML = ` <div class="thank-you-message" style="text-align: center;"> <h2>Thank You!</h2> <div class="thank-you-message-content">Your suggestions are valuable to us.</div> </div> `; }, error:function(data) { jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-modal-alert').html("Something went wrong."); jQuery('#suggestion-modal-alert').show(); error_msg = true; } }); } else{ jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-modal-alert').html("Minimum 5 Words and Maximum Character limit is 2000."); jQuery('#suggestion-modal-alert').show(); jQuery('#suggestion-section-textarea').focus(); error_msg = true; } } else{ jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-modal-alert').html("Enter atleast four words !"); jQuery('#suggestion-modal-alert').show(); jQuery('#suggestion-section-textarea').focus(); error_msg = true; } if(error_msg){ setTimeout(() => { jQuery('#suggestion-section-textarea').focus(); jQuery('#suggestion-modal-alert').hide(); }, 3000); } } document.querySelector('.suggest-bottom-btn').addEventListener('click', function(){ jQuery('body').append('<div class="spinner-loading-overlay"></div>'); jQuery('.spinner-loading-overlay').show(); if(loginData && loginData.isLoggedIn) { suggestionCall(); return; } // load the captcha script and set the token loadScript('https://www.google.com/recaptcha/api.js?render=6LdMFNUZAAAAAIuRtzg0piOT-qXCbDF-iQiUi9KY',[], function() { setGoogleRecaptcha(); }); }); $('.improvement-bottom-btn.create-improvement-btn').click(function() { //create improvement button is clicked $('body').append('<div class="spinner-loading-overlay"></div>'); $('.spinner-loading-overlay').show(); // send this option via create-improvement-post api jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id }), success:function(result) { $('.spinner-loading-overlay:eq(0)').remove(); $('.improve-modal--overlay').hide(); $('.create-improvement-redirection-to-write').attr('href',writeUrl + 'improve-post/' + `${result.id}` + '/', '_blank'); $('.create-improvement-redirection-to-write')[0].click(); }, error:function(e) { showErrorMessage(e.responseJSON,e.status); }, }); }); </script> <script> var AdblockPlus = new function() { this.detect = function(px, callback) { var detected = false; var checksRemain = 2; var error1 = false; var error2 = false; if (typeof callback != "function") return; px += "?ch=*&rn=*"; function beforeCheck(callback, timeout) { if (checksRemain == 0 || timeout > 1E3) callback(checksRemain == 0 && detected); else setTimeout(function() { beforeCheck(callback, timeout * 2) }, timeout * 2) } function checkImages() { if (--checksRemain) return; detected = !error1 && error2 } var random = Math.random() * 11; var img1 = new Image; img1.onload = checkImages; img1.onerror = function() { error1 = true; checkImages() }; img1.src = px.replace(/\*/, 1).replace(/\*/, random); var img2 = new Image; img2.onload = checkImages; img2.onerror = function() { error2 = true; checkImages() }; img2.src = px.replace(/\*/, 2).replace(/\*/, random); beforeCheck(callback, 250) } }; /* AdblockPlus.detect("https://cdnads.geeksforgeeks.org/res/px.gif", function(abp){ window.googletag = window.googletag || {cmd: []}; window.abp=abp; var elms = [...document.querySelectorAll('div[id^=_GFG_ABP_]')]; const units=elms.map(elem=>elem.id) if(abp) { for(let curr_unit of units) { const iframe = document.createElement('iframe'); iframe.setAttribute('src',"https://aa.geeksforgeeks.org/iframe.html?code="+curr_unit.substr(1)) const elem = document.getElementById(curr_unit) const div = document.createElement('div'); div.setAttribute('id',curr_unit.substr(1)) let sizes = curr_unit.split("_"); sizes = sizes.filter(val => val.includes('x')); let [width, height] = sizes[0].split("x"); iframe.style.width = `${+width+20}px` iframe.style.height = `${+height+20}px` if(elem) { elem.appendChild(iframe); } } var gfgAdDivs = [...document.querySelectorAll('div[id^=GFG_AD_]')]; gfgAdDivs.forEach(gfgDiv => document.getElementById(gfgDiv.id).removeAttribute("style")); jQuery('#secondary .widget_text:last-child').css({"position": "unset"}); } });*/ AdblockPlus.detect("https://cdnads.geeksforgeeks.org/res/px.gif", function(abp){ window.googletag = window.googletag || {cmd: []}; window.abp=abp; var elms = [...document.querySelectorAll('div[id^=_GFG_ABP_]')]; //const units=elms.map(elem=>elem.id) const units = elms .filter(elem => !(window.innerWidth < 1500 && elem.id === "_GFG_ABP_Incontent_728x90")) .map(elem => elem.id); if(abp) { isAdBlockerPresent = true; for(let curr_unit of units) { const iframe = document.createElement('iframe'); iframe.addEventListener("load", () => { iframe.contentWindow.postMessage(JSON.stringify({host: window.location.host,category: window.arrPostCatName,parentWidth: window.innerWidth}),'https://aa.geeksforgeeks.org'); }); iframe.setAttribute('src',"https://aa.geeksforgeeks.org/iframe.html?code="+curr_unit.substr(1)) const elem = document.getElementById(curr_unit) const div = document.createElement('div'); div.setAttribute('id',curr_unit.substr(1)) let sizes = curr_unit.split("_"); sizes = sizes.filter(val => val.includes('x')); let [width, height] = sizes[0].split("x"); iframe.style.width = `${+width+20}px` iframe.style.height = `${+height+20}px` if(elem) { elem.appendChild(iframe); } } var gfgAdDivs = [...document.querySelectorAll('div[id^=GFG_AD_]')]; gfgAdDivs.forEach(gfgDiv => document.getElementById(gfgDiv.id).removeAttribute("style")); jQuery('#secondary .widget_text:last-child').css({"position": "unset"}); } else{ try { var isAdblockEnabled = t => fetch( new Request('https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js', { method: 'HEAD', mode: 'no-cors' }) ).catch(t); isAdblockEnabled(() => { // here goes modal pop-up code isAdBlockerPresent = true; }); } catch (err) {console.log(err);} } }); function closeAdBlockPopupModal(){ const modal = document.getElementById("adBlockerModal"); $('body').removeClass('body-for-ad-blocker'); $('#adBlockerModal').remove() localStorage.setItem('gfgAdBlockPopup',new Date()) } function showAdblockerModal(){ let randomNumberForButtonText = Math.round(Math.random()); let currTime = new Date(); let lastTime = new Date(localStorage.getItem('gfgAdBlockPopup')); if(((currTime-lastTime)/(1000*60*60))<1) { return; } const adBlockerModal = `<div id="adBlockerModal" class="ad-blocker-modal"> <div id="ad-blocker-modal-overlay"> <div id="ad-blocker-outer-div"> <div id="ad-blocker-div"> <p id="ad-blocker-div-warning" style="margin-bottom: 30px;">It seems that you are using an ad blocker.<br><span style="font-size: 22px;font-weight: normal;">Please disable it to support us!</span></p> <div id="ad-blocker-div-btns"> <button id="ad-blocker-div-button1" onclick="handleAdBlockerClick('disabled')"> I disabled my ad blocker </button> <a href="https://www.geeksforgeeks.org/geeksforgeeks-premium-subscription${randomNumberForButtonText === 1 ? "/?itm_source=geeksforgeeks&itm_medium=adblocker&itm_campaign=premium1" : "/?itm_source=geeksforgeeks&itm_medium=adblocker&itm_campaign=premium2"}" target="_blank"> <button id="ad-blocker-div-button2" style=" background: linear-gradient(45deg, #f0bd36, #bf873f); border: 1px solid transparent; color: white; " > ${randomNumberForButtonText === 1 ? "Go Ad-Free with Premium" : "Upgrade for No Ads"} </button> </a> </div> <div id="ad-blocker-div-continue-premium-promo-text"> "For an ad-free experience and exclusive features, subscribe to our Premium Plan!"<br> </div> <div id="ad-blocker-div-continue-btn-div"> <a id="ad-blocker-div-continue-btn" href="#" onclick="closeAdBlockPopupModal()">Continue without supporting</a> </div> </div> </div> </div> </div>`; $('body').append(adBlockerModal); $('body').addClass('body-for-ad-blocker'); const modal = document.getElementById("adBlockerModal"); modal.style.display = "block"; } function handleAdBlockerClick(type){ if(type == 'disabled'){ window.location.reload(); } else if(type == 'info'){ document.getElementById("ad-blocker-div").style.display = "none"; document.getElementById("ad-blocker-info-div").style.display = "flex"; handleAdBlockerIconClick(0); } } var lastSelected= null; //Mapping of name and video URL with the index. const adBlockerVideoMap = [ ['Ad Block Plus','https://media.geeksforgeeks.org/auth-dashboard-uploads/abp-blocker-min.mp4'], ['Ad Block','https://media.geeksforgeeks.org/auth-dashboard-uploads/Ad-block-min.mp4'], ['uBlock Origin','https://media.geeksforgeeks.org/auth-dashboard-uploads/ub-blocke-min.mp4'], ['uBlock','https://media.geeksforgeeks.org/auth-dashboard-uploads/U-blocker-min.mp4'], ] function handleAdBlockerIconClick(currSelected){ const videocontainer = document.getElementById('ad-blocker-info-div-gif'); const videosource = document.getElementById('ad-blocker-info-div-gif-src'); if(lastSelected != null){ document.getElementById("ad-blocker-info-div-icons-"+lastSelected).style.backgroundColor = "white"; document.getElementById("ad-blocker-info-div-icons-"+lastSelected).style.borderColor = "#D6D6D6"; } document.getElementById("ad-blocker-info-div-icons-"+currSelected).style.backgroundColor = "#D9D9D9"; document.getElementById("ad-blocker-info-div-icons-"+currSelected).style.borderColor = "#848484"; document.getElementById('ad-blocker-info-div-name-span').innerHTML = adBlockerVideoMap[currSelected][0] videocontainer.pause(); videosource.setAttribute('src', adBlockerVideoMap[currSelected][1]); videocontainer.load(); videocontainer.play(); lastSelected = currSelected; } </script> <!-- <script async src="https://www.googleoptimize.com/optimize.js?id=OPT-5PGZ8MN"></script> --> <style> /* Temporary CSS for Three90 pop up modal (START)*/ .three90popup__container { width: 100vw; height: 100vh; position: fixed; top:0px; background: var(--job-tab-faded-background); z-index: 1024; display: flex; align-items: center; justify-content: center; } .three90modal__wrapper{ background-color: white; max-width: 350px; display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; } .three90modal__message-container { display: flex; flex-direction: column; align-items: center; font-family: var(--font-primary); } .three90modal__subheading { margin-top: 20px; font-size: 22px; font-weight: 600; } .three90modal__text-message { margin-top: 20px; font-size: 15px; font-weight: 400; text-align: center; padding: 0 5px; } .three90__modal__button-wrapper { width: 100%; padding: 20px 0px; display: flex; justify-content: space-evenly; } .three90__modal__button-wrapper > button { width: 105px; height: 35px; border-radius: 13px; border:none; font-weight: 600; cursor: pointer; } #three90__modal-close-btn:hover { background-color: #cacbcd; } #three90__modal-explore-btn { background-color: #0a0727; color: white } @media screen and (max-width: 441px) { .three90modal__wrapper { max-width: 300px; } } /* Temporary CSS for Three90 pop up modal (END)*/ </style> <script type="text/javascript" > const coursePromotionCities = JSON.parse(`{"NCR":{"LOCATIONS":["Noida","Greater Noida","Ghaziabad","Faridabad","Delhi","New Delhi"],"COURSES":[{"name":"GATE CS 2025 Classroom Program","url":"https:\/\/www.geeksforgeeks.org\/courses\/gate-cs-self-paced"},{"name":"MERN Full Stack Development","url":"https:\/\/www.geeksforgeeks.org\/courses\/mern-full-stack-development-classroom"},{"name":"DSA For Interview Preparation","url":" https:\/\/www.geeksforgeeks.org\/courses\/dsa-interview-preparation-classroom"},{"name":"JAVA Backend Development","url":"https:\/\/www.geeksforgeeks.org\/courses\/complete-java-backend-development-program"},{"name":"Data Analytics Programme","url":"https:\/\/www.geeksforgeeks.org\/courses\/complete-data-analytics-program"},{"name":"AWS Solutions Architect Certification","url":"https:\/\/www.geeksforgeeks.org\/courses\/aws-solutions-architect-certification-classroom-training"},{"name":"Explore All","url":"https:\/\/www.geeksforgeeks.org\/courses\/offline-courses"}]},"NON_NCR":{"Bengaluru":[{"name":"Data Science Classroom Program","url":"https:\/\/www.geeksforgeeks.org\/courses\/data-science-classroom-program"},{"name":"System Design Classroom Program","url":"https:\/\/www.geeksforgeeks.org\/courses\/system-design-classroom-program"},{"name":"MERN Full Stack Development","url":"https:\/\/www.geeksforgeeks.org\/courses\/mern-full-stack-development-classroom"},{"name":"DSA For Interview Preparation","url":"https:\/\/www.geeksforgeeks.org\/courses\/dsa-interview-preparation-classroom"},{"name":"JAVA Backend Development","url":"https:\/\/www.geeksforgeeks.org\/courses\/complete-java-backend-development-program"},{"name":"Data Analytics Programme","url":"https:\/\/www.geeksforgeeks.org\/courses\/complete-data-analytics-program"},{"name":"AWS Solutions Architect Certification","url":"https:\/\/www.geeksforgeeks.org\/courses\/aws-solutions-architect-certification-classroom-training"},{"name":"Explore All","url":"https:\/\/www.geeksforgeeks.org\/courses\/offline-courses"}],"Pune":[{"name":"MERN Full Stack Development","url":"https:\/\/www.geeksforgeeks.org\/courses\/mern-full-stack-development-classroom"},{"name":"DSA For Interview Preparation","url":"https:\/\/www.geeksforgeeks.org\/courses\/dsa-interview-preparation-classroom"},{"name":"Complete Data Analytics Program","url":"https:\/\/www.geeksforgeeks.org\/courses\/complete-data-analytics-program"},{"name":"Explore All","url":"https:\/\/www.geeksforgeeks.org\/courses\/offline-courses"}]}}`); const offlineCourseTermMapper = JSON.parse(`{"ALL_TERMIDS":["2058","6263","2628","1745","1789","2601","2057","5037","2971","2023","2162","2795"],"COURSE_TERMID_MAP":{"JAVA":["2058"],"DATA_ANALYTICS":["1745","1789","2601","2057","5037","2971","2023","2162","2795"],"DSA":["6263"],"MERN":["2628"]}}`); </script> <!-- gfg tabs compatablity bundled js --> <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-KDVRCT5');</script> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-DWCCJLKX3X"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); // gtag('config', 'AW-474915276'); gtag('config', 'G-DWCCJLKX3X'); gtag('config', 'AW-796001856'); </script> <!-- fancybar ad code start --> <div id="GFG_AD_Desktop_Stickyunit_1x1"></div> <!-- fancybar ad code ends --> <!-- <div id="GFG_AD_gfg_mobile_320x50"></div> --> <style> :root { --com-extra-icons-mobile-image: url(https://media.geeksforgeeks.org/auth-dashboard-uploads/Com-Extra-Icons13.svg); --write-experience-card-1: #ECF5F5; --write-experience-card-icon-1: #21898C; --write-experience-card-2: #EAF2F7; --write-experience-card-icon-2: #3079AC; --write-experience-card-3: #FDEFE6; --write-experience-card-icon-3: #F5A572; --write-experience-card-4: #F1F8F5; --write-experience-card-icon-4: #91C4AD; --write-experience-card-5: #EEE7FF; --write-experience-card-icon-5: #8B72C9; --write-experience-card-6: #F2F8E6; --write-experience-card-icon-6: #78C57F; --editor-button-text-color: #6E6E73; --write-modal-background: #fefefe; --experience-sidebar: #000; --left-bar-background: #FFFFFF; --write-redirect-container:#EAF2F7; --write-redirect-container-hover:#d6e7f2; } /* Dark Mode */ body[data-dark-mode="true"] { --write-modal-background: #161c23; --experience-sidebar: #000; --left-bar-background: #F0F3F5; } .popup-main { padding: 20px 18px 20px 18px; border-radius: 8px; } .popup-main .popup-heading { display: flex; align-items: center; color: #E9E9EA; margin-bottom: 10px; justify-content: space-between; } .popup-main .close-icon { background-image: var(--com-extra-icons-mobile-image);background-position: -15px -1651px;height: 22px;width: 22px;transform: scale(1); margin-bottom: 12px; cursor: pointer; } .popup-main .experience-card { color: #000; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; /* margin-bottom:10px; */ } .popup-main a:hover, .popup-main a:active, .popup-main a:visited { color: inherit; text-decoration: none; } .popup-main .exp-card1, .popup-main .exp-card2, .popup-main .exp-card3, .popup-main .exp-card4, .popup-main .exp-card5, .popup-main .exp-card6 { display: flex; align-items: center; border-radius: 10px; cursor: pointer; } .popup-main .exp-card1 .icon1, .popup-main .exp-card2 .icon2, .popup-main .exp-card3 .icon3, .popup-main .exp-card4 .icon4, .popup-main .exp-card5 .icon5, .popup-main .exp-card6 .icon6 { width: 80px; height: 80px; border-radius: 10px 0px 0px 10px; display: flex; align-items: center; justify-content: center; background: var(--write-experience-card-icon-1); } .popup-main .exp-card1 .icon1, .popup-main .exp-card2 .icon2, .popup-main .exp-card3 .icon3, .popup-main .exp-card4 .icon4, .popup-main .exp-card5 .icon5, .popup-main .exp-card6 .icon6 { width: 80px; height: 80px; border-radius: 10px 0px 0px 10px; display: flex; align-items: center; justify-content: center; } .popup-main .exp-card1 .icon1 { background: var(--write-experience-card-icon-1); } .popup-main .exp-card2 .icon2 { background: var(--write-experience-card-icon-2); } .popup-main .exp-card3 .icon3 { background: var(--write-experience-card-icon-3); } .popup-main .exp-card4 .icon4 { background: var(--write-experience-card-icon-4); } .popup-main .exp-card5 .icon5 { background: var(--write-experience-card-icon-5); } .popup-main .exp-card6 .icon6 { background: var(--write-experience-card-icon-6); } .popup-main .exp-card6 .icon6-image { background-image: url(https://media.geeksforgeeks.org/auth-dashboard-uploads/compass.svg); width: 46px; height: 30px; background-size: 30px; background-repeat: no-repeat; background-position: center; } .popup-main .exp-card1 .icon1-image { background-image: var(--com-extra-icons-mobile-image); width: 46px; height: 28px; background-position: -4px -812px; } .popup-main .exp-card2 .icon2-image { background-image: var(--com-extra-icons-mobile-image); width: 46px; height: 28px; background-position: -4px -888px; } .popup-main .exp-card3 .icon3-image { background-image: var(--com-extra-icons-mobile-image); width: 46px; height: 28px; background-position: -4px -848px; } .popup-main .exp-card4 .icon4-image { background-image: url(https://media.geeksforgeeks.org/auth-dashboard-uploads/competitive.svg); width: 46px; height: 30px; background-size: 30px; background-repeat: no-repeat; background-position: center; } .popup-main .exp-card5 .icon5-image { background-image: var(--com-extra-icons-mobile-image); width: 46px; height: 33px; background-position: -4px -1217px; } .popup-main .exp-card1 .exp-card1-text, .popup-main .exp-card2 .exp-card2-text, .popup-main .exp-card3 .exp-card3-text, .popup-main .exp-card4 .exp-card4-text, .popup-main .exp-card5 .exp-card5-text, .popup-main .exp-card6 .exp-card6-text { display: flex; align-items: center; border-radius: 0px 10px 10px 0px; height: 80px; width: calc(100% - 80px); } .popup-main .exp-card1 { justify-content: flex-start; background: var(--write-experience-card-1); } .popup-main .exp-card2 { justify-content: flex-start; background: var(--write-experience-card-2); } .popup-main .exp-card3 { justify-content: flex-start; background: var(--write-experience-card-3); } .popup-main .exp-card4 { justify-content: flex-start; background: var(--write-experience-card-4); } .popup-main .exp-card5 { justify-content: flex-start; background: var(--write-experience-card-5); } .popup-main .exp-card6 { justify-content: flex-start; background: var(--write-experience-card-6); } .popup-main span { font-family: var(--font-primary); font-size: 14px; font-style: normal; font-weight: 500; line-height: normal; padding-left: 5px; padding-right: 5px; } #popup { display: none; background-color: var(--write-modal-background); padding: 20px; text-align: center; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1026; width: min(650px, calc(100% - 20px)); } .link-container-write{ display:flex; flex-direction:column; } .link-container-write > a { margin:7px 0px; } .phrase__container{ color:var(--color-gfg); border-radius: 6px; width: 100%; background-color:var(--write-redirect-container); padding: 15px; text-align: justify; font-size:14px; } .phrase__container:hover { color:var(--color-gfg) !important; background-color:var(--write-redirect-container-hover); } </style> <div class="popup-container"> <div id="popup" accesskey="" class="popup-main"> <div class="popup-heading"> <h2>What kind of Experience do you want to share?</h2> <div class="close-icon share-experience-modal-close"></div> </div> <!-- <span class="description"style="color: #BEBEC2;">Tell us your type of experiences which can help other fellow Geeks for their future events and preparations.</span> --> <div class="experience-card"> <a class="exp-card5" href= "https://write.geeksforgeeks.org/posts-new?cid=e8fc46fe-75e7-4a4b-be3c-0c862d655ed0" target="_blank"> <div class="icon5"> <div class="icon5-image"></div> </div> <div class="exp-card5-text"> <span style="color: #000;">Interview Experiences</span> </div> </a> <a class="exp-card1" href="https://write.geeksforgeeks.org/posts-new?cid=82536bdb-84e6-4661-87c3-e77c3ac04ede" target="_blank"> <div class="icon1"> <div class="icon1-image"></div> </div> <div class="exp-card1-text"> <span style="color: #000;">Admission Experiences</span> </div> </a> <a class="exp-card6" href= "https://write.geeksforgeeks.org/posts-new?cid=5219b0b2-7671-40a0-9bda-503e28a61c31" target="_blank"> <div class="icon6"> <div class="icon6-image"></div> </div> <div class="exp-card6-text"> <span style="color: #000;">Career Journeys</span> </div> </a> <a class="exp-card2" href="https://write.geeksforgeeks.org/posts-new?cid=22ae3354-15b6-4dd4-a5b4-5c7a105b8a8f" target="_blank"> <div class="icon2"> <div class="icon2-image"></div> </div> <div class="exp-card2-text"> <span style="color: #000;">Work Experiences</span> </div> </a> <a class="exp-card3" href= "https://write.geeksforgeeks.org/posts-new?cid=c5e1ac90-9490-440a-a5fa-6180c87ab8ae" target="_blank"> <div class="icon3"> <div class="icon3-image"></div> </div> <div class="exp-card3-text"> <span style="color: #000;">Campus Experiences</span> </div> </a> <a class="exp-card4" href= "https://write.geeksforgeeks.org/posts-new?cid=5ebb8fe9-b980-4891-af07-f2d62a9735f2" target="_blank"> <div class="icon4"> <div class="icon4-image"></div> </div> <div class="exp-card4-text"> <span style="color: #000;">Competitive Exam Experiences</span> </div> </a> </div> <!-- <div class="link-container-write"> <a href="https://write.geeksforgeeks.org/pick-article?taxonomy=10261&page=1"> <div role="span" class="phrase__container"> Can't choose a topic to write? click here for suggested topics </div> </a> <a href="https://write.geeksforgeeks.org/posts-new"> <div role="span" class="phrase__container"> Write and publish your own Article </div> </a> </div> --> </div> <div id="overlay" onclick="toggleExperiencePopup()" style="display: block;min-height: 100vh;min-width: 100vw;position: fixed;top: 0;bottom: 0;right: 0;left: 0;display: none;justify-content: center;align-items: center;background: rgba(0,0,0,.702);z-index: 1025 !important;backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);word-break: keep-all;"></div> </div> <script> $('.share-experience-modal').click(function(e){ e.preventDefault(); var link = $(this).attr('href'); toggleExperiencePopup(link); }); function toggleExperiencePopup(link) { var popup = document.getElementById("popup"); var overlay = document.getElementById("overlay"); if (window.innerWidth < 992) { window.location.href = link; } else { popup.style.display = (popup.style.display === "block") ? "none" : "block"; overlay.style.display = (overlay.style.display === "block") ? "none" : "block"; } } $('.share-experience-modal-close').click(function(e){ var popup = document.getElementById("popup"); popup.style.display = 'none'; var overlay = document.getElementById("overlay"); overlay.style.display = 'none'; }); </script> </div><script type="text/javascript"> $(window).on('load', function() { (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "ayc7ypwwuk"); }); </script> <!-- Chat bot is being shown for these category articles (8 -> linked-list 9172 -> AI-ML-DS, 1789 -> python 4667 -> math) --> </body> </html>