Skip to content

Instantly share code, notes, and snippets.

View NiT24's full-sized avatar

NITIN AHER NiT24

View GitHub Profile
@NiT24
NiT24 / Sorting.c
Created January 20, 2021 13:40
Accept mobile user information(eg.Mobile No,Name,Bill amount) 1. Display the data in descending order of Mobile No.(insertion sort). 2. Display data in ascending order of name (selection sort). 3. Display details of Mobile no specified by user (Binary search). 4. Display the number of passes and comparisons for different test cases(Worst, Averag…
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct mobile
{
long mobileno;
char name[20];
float billamt;
}mobile;
@NiT24
NiT24 / Sorting.c
Created January 20, 2021 13:36
Acccept Student informtiom(eg. Roll No,Name,Percentage) 1. Display the data in descending order of percentage(Bubble sort) 2. Display data for Roll No. specified by the user(linear search). 3. Display the number of passes and comparisons for different test cases(Worst, Average,Best case).
#include <stdio.h>
#include <string.h>
#include<stdlib.h>
typedef struct student
{
int rollno;
char name[20];
float perc;
}student;
void read(student st[],int n);
@NiT24
NiT24 / databasewithpointer.c
Created January 20, 2021 13:33
Create a Database using array of structures and perform following operations on it: i.Create Database ii.Display Database iii.Add record iv.Search record v.Modify record vi.Delete record
#include <stdio.h>
#include <string.h>
#include<stdlib.h>
typedef struct employee
{
int code;
char name[20];
int salary;
}employee;
void read(employee *st,int n);
@NiT24
NiT24 / database.c
Created January 20, 2021 13:30
Create a Database using array of structures and perform following operations on it: i.Create Database ii.Display Database iii.Add record iv.Search record v.Modify record vi.Delete record
#include <stdio.h>
#include <string.h>
#include<stdlib.h>
typedef struct employee
{
int code;
char name[20];
int salary;
}employee;
void read(employee st[],int n);
@NiT24
NiT24 / StringWithPointer.c
Created January 20, 2021 13:29
Implement following operations on string with pointers (without using library functions) i.Length ii.Palindrome iii.String comparison iv.Copy v.Reverse vi.Substring
#include <stdio.h>
#include<ctype.h>
#include<stdlib.h>
void reverse(char *a);
int palindrome(char *a);
void copy(char *b,char *a);
int compare(char *a,char *b);
void search(char *a,char *b);
@NiT24
NiT24 / StringWithoutPointer.c
Created January 20, 2021 13:26
Implement following operations on string without pointers (without using library functions) i.Length ii.Palindrome iii.String comparison iv.Copy v.Reverse vi.Substring
#include<stdio.h>
#include<stdlib.h>
void length(char a[10]);
int palindrome(char a[10]);
int compare(char a[10],char b[10]);
void copy(char a[10],char b[10]);
void reverse(char a[10],char b[10]);
void substr(char a[] ,char b[]);
@NiT24
NiT24 / MatrixWithPointer.c
Created January 20, 2021 13:25
Represent matrix using two dimensional arrays and perform following operations with and without pointers: i.Addition ii.multiplication iii.transpose iv.Saddle point
#include<stdio.h>
#include<stdlib.h>
int** create(int m ,int n);
void create1(int a[][10],int m , int n);
void print(int **a,int m ,int n);
void print1(int a[][10], int m , int n);
void transpose(int **a,int m ,int n);
int** addmat(int **a,int m1,int n1 ,int **b,int m2,int n2);
void multmat(int a[][10],int m1,int n1 ,int b[][10],int m2,int n2,int c[][10]);
int saddle(int a[][10],int m,int n);
@NiT24
NiT24 / Matrix.c
Created January 20, 2021 13:23
Represent matrix using two dimensional arrays and perform following operations with and without pointers: i.Addition ii.multiplication iii.transpose iv.Saddle point
#include<stdio.h>
#include<stdlib.h>
int create(int a[10][10],int m,int n);
void add(int a[10][10],int b[10][10],int c[10][10],int m1,int n1);
void mul(int a[10][10],int b[10][10],int c[10][10],int m1,int n1);
void transpose(int a[10][10],int c[10][10],int m1,int n1);
int saddle(int a[][10],int m,int n);
int main()
@NiT24
NiT24 / Sets.c
Created January 20, 2021 13:20
Represent sets using one dimensional arrays and implement functions to perform i.Union ii.Intersection iii.Difference iv.Symmetric difference of two sets
#include<stdio.h>
#include<stdlib.h>
#define M 40
int Create(int s[]);
void Display(int s[],int x);
int Union(int s1[],int s2[],int s3[],int m,int n);
int Intersection(int s1[],int s2[],int s3[],int m,int n);
int Difference(int s1[],int s2[],int s3[],int m,int n);
@NiT24
NiT24 / Aggregate.c
Created January 20, 2021 12:43
The above C program is to calculate the aggregate of numbers.
#include<stdio.h>
void main()
{
int a[5];
int i,marks,t,sub;
float agg=0;
printf("\nEnter the no. of subjects:");
scanf("%d",&sub);