#!/bin/bash read -p “Enter start (2-x)>> ” start read -p “Enter end (2-x)>> ” end for((i=$start;i<=$end;i++)) do flag=0 for((j=2;j<$i;j++)) do if [ $(( $i%$j )) -eq…

Rich Engineer - Study Materials, Tutorials, Updates and much more!

#include<stdio.h> #include<stdlib.h> #define CAPACITY 5 struct stack { int data[CAPACITY]; int tos; }; typedef struct stack * STACK; void print(STACK x){ printf(“S>> n”); for(int…

Rich Engineer - Study Materials, Tutorials, Updates and much more!

/////////////////////////////////////parent/////////////////////////////// #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/shm.h> #include <sys/wait.h> #include <string.h> void main(){ int shmid, n; int *shared_memory; shmid = shmget((key_t)110011, 1024, 0666|IPC_CREAT); shared_memory…

Rich Engineer - Study Materials, Tutorials, Updates and much more!

#include <stdio.h> #include <stdlib.h> struct node { int data; struct node *right, *left; }; typedef struct node* NODE; NODE createNode(int data){ NODE temp = (NODE)malloc(sizeof(struct…

Rich Engineer - Study Materials, Tutorials, Updates and much more!

#include <stdio.h> #include <stdlib.h> struct node{ int data; struct node* link; }; typedef struct node* NODE; NODE createNode(){ NODE temp = (NODE)malloc(sizeof(struct node)); temp->link =…

Rich Engineer - Study Materials, Tutorials, Updates and much more!

#include<stdio.h> #include<stdlib.h> struct stack { int *data; int tos; }; typedef struct stack * STACK; void print(STACK x){ printf(“S>> n”); for(int i = x->tos;…

Rich Engineer - Study Materials, Tutorials, Updates and much more!

/////////////////////////////////////////parenrt//////////////////////////////////////// //Include -lrt while compiling #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/shm.h> #include <sys/wait.h> #include <sys/mman.h> #include <fcntl.h> void main(){ int fd, n; int buffer[25]; …

Rich Engineer - Study Materials, Tutorials, Updates and much more!

#include <stdio.h> #include <stdlib.h> typedef struct student { char name[10]; int roll_no; int m1,m2,m3; float avg_marks; } STD; void read(int,STD *); void display(int, STD…

Rich Engineer - Study Materials, Tutorials, Updates and much more!

#include <stdio.h> #include <stdlib.h> void read(int,int*); void display(int, int*); int search(int, int*,int); int sort(int,int*); void insert(int*,int*,int,int); void deleteIndex(int*,int*,int); void deleteValue(int*,int*,int); void main(){ int i,n,choice,arr[25],key,pos; while(1){ …

Rich Engineer - Study Materials, Tutorials, Updates and much more!

#include <stdio.h> #include <ctype.h> #include <string.h> int stack[10]; int tos =-1; void push(char x){ stack[++tos] = x; } int pop(){ return stack[tos–]; } void main(){ …

Rich Engineer - Study Materials, Tutorials, Updates and much more!