Write a script which enters username s& password & check that if the username = sugc& password=98765 then display the valid user message. Otherwise invalid user.

Write a script which enters username s& password & check that if the username = sugc& password=98765 then display the valid user message. Otherwise invalid user. SOLUTION…. #!/bin/bash # Script to check username & password with max 3 attempts correct_user=”sugc” correct_pass=”98765″ attempt=1 max_attempts=3 while [ $attempt -le $max_attempts ] do echo “Attempt $attempt of $max_attempts” […]

Write a shell script to reverse a given number.

Write a shell script to reverse a given number. SOLUTION…. #!/bin/bash # Script to reverse a given number echo “Enter a number: ” read num rev=0 orig=$num # keep original number for display while [ $num -gt 0 ] do rem=$((num % 10)) # get last digit rev=$((rev * 10 + rem)) # build reverse […]

Explain loops in Kotlin with example.

Explain loops in Kotlin with example. SOLUTION…. Loops in Kotlin Introduction In programming, loops are used to execute a block of code repeatedly until a certain condition is met. Instead of writing the same code multiple times, loops help in repetition, automation, and reducing redundancy. Kotlin, being a modern programming language, provides several types of […]

Write about the features of React.JS with its advantages and disadvantages

Write about the features of React.JS with its advantages and disadvantages SOLUTION…. React.js – Features, Advantages, and Disadvantages Introduction React.js (commonly called React) is a popular open-source JavaScript library developed by Facebook in 2013 for building user interfaces (UI), especially for single-page applications. It helps developers create fast, scalable, and interactive web apps by breaking […]

Explain React Components in detail.

Explain React Components in detail. SOLUTION…. What are React Components? React is a JavaScript library used for building user interfaces, and the foundation of React applications is components. A component in React is like a small, reusable piece of code that represents part of the user interface. Think of it as a building block. Just […]