Posts

My Landing Page

"Welcome to Saurav's Portfolio! I’m a passionate web developer dedicated to crafting responsive and visually engaging websites. With a focus on clean code, intuitive design, and seamless user experiences, I blend creativity and technical skills to bring ideas to life on the web. Explore my journey through a collection of projects, each showcasing my growth and expertise in web development. From sleek landing pages to dynamic applications, every piece reflects my commitment to quality and innovation. Let’s connect—whether you’re here to collaborate, seek inspiration, or just explore, I’m excited to share my work with you!" Feel free to adjust any details to better align with your style and focus.

Knapasack

 # include<stdio.h>   void knapsack(int n, float weight[], float profit[], float capacity) {    float x[20], tp = 0;    int i, j, u;    u = capacity;      for (i = 0; i < n; i++)       x[i] = 0.0;      for (i = 0; i < n; i++) {       if (weight[i] > u)          break;       else {          x[i] = 1.0;          tp = tp + profit[i];          u = u - weight[i];       }    }      if (i < n)       x[i] = u / weight[i];      tp = tp + (x[i] * profit[i]);      printf("\nThe result vector is:- ");    for (i = 0; i < n; i++)       printf("%f\t", x[i]);      printf("\nMaximum profit is:- %f", tp);   }   int main() {    float weight[20], profit[20], capacity;    int num, i, j;    float ratio[20], temp;      printf("\nEnter the no. of objects:- ");    scanf("%d", &num);      printf("\nEnter the wts and profits of each object:- ");    for (i = 0; i < num; i++) {       scanf("%f %f", &weight[i], &am

If else condition

Image
  Mastering JavaScript: Unleashing the Power of If-Else Conditions for Web Development: In JavaScript, an if-else statement allows you to make decisions and execute different blocks of code based on a condition. It follows a simple structure: if ( condition ) {   // Code to execute if the condition is true } else {   // Code to execute if the condition is false } The condition is a logical expression that evaluates to either true or false. If the condition is true, the code within the first block will run. Otherwise, the code within the else block will execute. If you have multiple conditions to check, you can use else-if statements:         if ( condition1 ) {   // Code to execute if condition1 is true } else if ( condition2 ) {   // Code to execute if condition1 is false and condition2 is true } else {   // Code to execute if both condition1 and condition2 are false } By utilizing if-else statements and conditions, you can create dynamic and responsive JavaScript code that perf
  JavaScript Arrow Function: In JavaScript, an arrow function is a concise way of writing a function expression. It was introduced in  ES6  and provides a shorter syntax compared to traditional function expressions. Arrow functions are often used for creating anonymous functions or for defining functions with a shorter and more readable syntax.                                                                                                                  Here's an example of an arrow function and its equivalent traditional function expression: Arrow Function:       // Arrow function syntax: (parameters) => { function body } // Example 1: A simple arrow function that adds two numbers const add = ( a , b ) => {   return a + b ; }; // Example 2: Arrow function with implicit return (for one-liner functions) const square = ( num ) => num * num ; // Example 3: Arrow function with no parameters const sayHello = () => {   console . log ( "Hello!" ); }; //

Data types & Operators

Image
  Data types Number : Used to represent a number such as 1, 3.14, or -10. String : "Hello world!" This is used to represent text in a sentence or two, such as "JavaScript". Boolean : Represents true or false. used in functions and conditions. Null : Indicates that no value was created intentionally. Undefined : Indicates a variable that has been declared but not yet assigned a value. Object : A complex data type that can contain many values ​​and objects. Objects can be created using curly braces {}. Operators Operators, on the other hand, are symbols or elements used to control values ​​and variables. JavaScript provides many operators, including: 1.Arithmetic operators:  addition (+), subtraction (-), equals (*), division (/), etc. It is used for basic mathematic calculations. 2.Assignment Operators:  It is  used to assign values to variables like the equal sign (=) or +=, -= , *= etc.  3.Comparison operators:  equal (==), not equal (!=), greater than (>), less
Image
    👉 What is an Array? In JavaScript, an array is a versatile data structure used to store multiple values in a single variable.  It allows you to group related data together and perform various operations on them. To create an array, you can use square brackets and separate the values with commas: let myArray = [ value1 , value2 , value3 ]; Arrays can store any type of data, including numbers, strings, objects, and even other arrays. The elements in an array are accessed using their index, which starts from 0 for the first element: let firstElement = myArray[ 0 ]; // Accessing the first element   Arrays have several built-in methods that enable powerful data manipulation. Some commonly used methods include: push : Adds elements to the end of an array. pop : Removes the last element from an array. length : Returns the number of elements in an array. indexOf : Returns the index of a specified element in an array. Here's an example showcasing these methods:  let fruits = [ &q
Let's start animation in CSS  ðŸ‘‰ GO ON COMPLETE PAGE