Write script to check inputted file is regular file , directory or does not exist .
Write script to check inputted file is regular file , directory or does not exist . SOLUTION…. #!/bin/bash # Script to check if inputted file is regular file, directory or does not exist echo “Enter the file or directory name:” read fname if [ -f “$fname” ]; then echo “$fname is a regular file.” elif […]
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 […]
Write script using case statement to perform basic math operations ( + , – , * , / , % ).
Write script using case statement to perform basic math operations ( + , – , * , / , % ). SOLUTION…. #!/bin/bash # Script to perform basic math operations using case statement echo “Enter first number: ” read num1 echo “Enter second number: ” read num2 echo “Choose operation (+, -, *, /, %): […]
Explain if and when in Kotlin. Differentiate if and when.
Explain if and when in Kotlin. Differentiate if and when. SOLUTION…. OUTPUT
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 […]
What is a module in AngularJS? Also explain how to create a controller of the module with an example.
What is a module in AngularJS? Also explain how to create a controller of the module with an example. SOLUTION…. What is a module in AngularJS — and how to create a controller for it (detailed) A module in AngularJS (Angular 1.x) is a container that groups related parts of an application — controllers, services, […]
Describe in detail how to validate forms in AngularJS.
Describe in detail how to validate forms in AngularJS. SOLUTION Form Validation in AngularJS Form validation is the process of checking whether the data entered by a user is correct, complete, and acceptable before submitting it. AngularJS makes form validation easier by providing built-in directives, CSS classes, and properties that help in real-time validation. 1. […]
Explain expressions and filters in AngularJS.
Explain expressions and filters in AngularJS. SOLUTION…. Expressions and Filters in AngularJS 1. AngularJS Expressions Expressions in AngularJS are pieces of code written inside double curly braces {{ }}. They are used to bind data between the model (scope variables) and the view (HTML page). Purpose: To display dynamic values or evaluate simple calculations directly […]
