{"id":2494,"date":"2023-04-14T07:30:14","date_gmt":"2023-04-14T07:30:14","guid":{"rendered":"https:\/\/codeinsightacademy.com\/blog\/?page_id=2494"},"modified":"2025-09-21T14:57:42","modified_gmt":"2025-09-21T14:57:42","slug":"demo","status":"publish","type":"page","link":"https:\/\/codeinsightacademy.com\/blog\/","title":{"rendered":"Demo"},"content":{"rendered":"\n<h2>Basic<\/h2>\n\n\n\n<ol><li>WAP to read 2 numbers and print addition of those two numbers<\/li><li>WAP to read 2 numbers and print subtraction<\/li><li>WAP to read 2 numbers and print multiplication<\/li><li>WAP to read 2 numbers and print division<\/li><li>WAP to read 2 numbers and print modulus (Remainder)<\/li><li>WAP to read radius and print area and circumference of circle<\/li><li>WAP to read length and breadth and print area and perimeter of rectangle<\/li><\/ol>\n\n\n\n<h2>Conditional Statement (if else)<\/h2>\n\n\n\n<ol><li>WAP to read a number and check if its positive or negative<\/li><li>WAP to read a number and check it is even or odd<\/li><li>WAP to read 2 numbers and find greatest among them<\/li><li>WAP to read 3 numbers and find greatest among them<\/li><li>WAP to read marks of 5 subjects and check the student is pass or failed<ol><li>add validation for marks less than 0<\/li><li>add validation for marks greater than 100<\/li><\/ol><\/li><\/ol>\n\n\n\n<h2>Loops<\/h2>\n\n\n\n<ol><li>WAP to print hello world 10 times with numbering<\/li><li>WAP to print square of numbers from 1 to 10<\/li><li>WAP to print numbers from 1 to given number<\/li><li>WAP to print cube of numbers from 1 to given number<\/li><li>WAP to read a number and print table of that number<\/li><li>WAP to execute Fizz Buzz Problem \/ Print number 1 to 100<ol><li>if number is divisible by 3 then print Fizz<\/li><li>if number is divisible by 5 then print Buzz<\/li><li>if number is divisible by both 3 and 5 then print Fizz Buzz<\/li><\/ol><\/li><li>WAP to execute lift program of 20 floor<ol><li>print number with delay of 1 sec (use time module&#8217;s sleep method)<\/li><li>skip 13 number<\/li><li>break after printing 13 <\/li><\/ol><\/li><li>WAP to create random jackpot number and take input from user to guess the number. Based on level the attempt to guess the number should change<ol><li>Easy \u2013 20 attempts<\/li><li>Medium \u2013 10 attempts<\/li><li>Difficult \u2013 5 attempts<\/li><\/ol><\/li><\/ol>\n\n\n\n<h2>Array<\/h2>\n\n\n\n<ol><li>WAP to find average of on array<\/li><li>WAP to find greatest number from an array<\/li><li>WAP to count all EVEN and ODD numbers<\/li><li>WAP to find sum, mean, min, max from array<\/li><li>WAP to search a number in it<\/li><li>WAP to sort it in ascending order<\/li><\/ol>\n\n\n\n<h2>Array of JSON<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>const employees = &#91;\n{ id: 1, name: \"Amit Sharma\", department: \"HR\", salary: 35000 },\n{ id: 2, name: \"Priya Verma\", department: \"IT\", salary: 50000 },\n{ id: 3, name: \"Ravi Kumar\", department: \"Finance\", salary: 60000 },\n{ id: 4, name: \"Neha Singh\", department: \"IT\", salary: 55000 },\n{ id: 5, name: \"Vikram Patel\", department: \"HR\", salary: 40000 },\n{ id: 6, name: \"Anjali Mehta\", department: \"Marketing\", salary: 45000 },\n{ id: 7, name: \"Suresh Reddy\", department: \"Finance\", salary: 70000 },\n{ id: 8, name: \"Kiran Nair\", department: \"IT\", salary: 48000 },\n{ id: 9, name: \"Pooja Joshi\", department: \"Marketing\", salary: 42000 },\n{ id: 10, name: \"Arjun Desai\", department: \"Finance\", salary: 65000 }\n];<\/code><\/pre>\n\n\n\n<ol><li>Write a program to print all employee names.<\/li><li>Write a program to find employees from the IT department.<\/li><li>Write a program to find the employee with the highest salary.<\/li><li>Write a program to calculate the total salary of all employees.<\/li><li>Write a program to increase the salary of HR employees by 10%.<\/li><li>Write a program to get all employees with a salary greater than 50,000.<\/li><li>Write a program to sort employees by salary in ascending order.<\/li><li>Write a program to find the average salary of employees in the Finance department.<\/li><li>Write a program to find an employee by a given ID.<\/li><li>Write a program to group employees by their department.<\/li><\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Basic WAP to read 2 numbers and print addition of those two numbers WAP to read 2 numbers and print subtraction WAP to read 2 numbers and print multiplication WAP to read 2 numbers and print division WAP to read 2 numbers and print modulus (Remainder) WAP to read radius and print area and circumference [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":871,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/pages\/2494"}],"collection":[{"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/comments?post=2494"}],"version-history":[{"count":4,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/pages\/2494\/revisions"}],"predecessor-version":[{"id":2880,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/pages\/2494\/revisions\/2880"}],"up":[{"embeddable":true,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/pages\/871"}],"wp:attachment":[{"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/media?parent=2494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}