Skip to content

Instantly share code, notes, and snippets.

View saharshg29's full-sized avatar

saharshg29

View GitHub Profile
let arra = [1, 4, 5, 6, 7]
var duplicate = []
let o = []
let e = []
var on = 0;
var en = 0;
console.log("original array ", arra)
#include <stdio.h>
struct student
{
char firstName[50];
int regno;
int marks1;
int marks2;
int marks3;
int marks4;
int marks5;
#include <stdio.h>
// removing duplicate element from array
void main()
{
int n, m;
//Declaring arrays
printf("Enter the size of array 1 \n");
scanf("%i", &n);
#include <stdio.h>
void main()
{
int n, m;
printf("Enter the size of array 1 \n");
scanf("%i", &n);
int arr[n];
int cpy[n]; // COPY OF ARRAY 1
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-- > 0) {
boolean prime = true;
int n = sc.nextInt();
if(n == 1){
/* package codechef; // don't place package name! */
import java.util.*;
class Codechef
{
public static void main (String[] args)
{
Scanner input =new Scanner(System.in);
int t=input.nextInt();
#include <stdio.h>
int main(void)
{
// your code goes here
int n, x, y;
int sum = 0;
int day = 0;
int k = 1;
scanf("%i", &n);
@saharshg29
saharshg29 / login.html
Created August 3, 2023 13:55
LogIn HTML CSS Bootstrap
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Login Page</title>
<style>
.container {
width: 400px;
margin: 0 auto;
@saharshg29
saharshg29 / main.js
Created August 3, 2023 13:56
This is main js file for previous html file
function validateLogin() {
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
if (username === "" || password === "") {
alert("Please enter your username and password.");
return false;
}
var xhr = new XMLHttpRequest();
@saharshg29
saharshg29 / validate.js
Created August 3, 2023 17:40
Login validation using js
function validateLoginForm() {
const usernameInput = document.getElementById('username');
const passwordInput = document.getElementById('password');
const username = usernameInput.value.trim();
const password = passwordInput.value.trim();
if (username === '' || password === '') {
alert('Please fill in all fields.');
return false;