mirror of
https://github.com/TheAlgorithms/C
synced 2024-11-25 14:59:36 +03:00
commit
ffd651dd18
@ -16,7 +16,7 @@ void main(){
|
||||
|
||||
int a[s];
|
||||
printf("Enter the contents for an array of size %d:\n", s);
|
||||
for (i = 0; i < s; i++) scanf("%d", &a[i]);
|
||||
for (i = 0; i < s; i++) scanf("%d", &a[i]);// accepts the values of array elements until the loop terminates//
|
||||
|
||||
printf("Enter the value to be searched:\n");
|
||||
scanf("%d", &v);
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void swap (int *a,int *b)
|
||||
void swap (int *a,int *b)//To swap the variables//
|
||||
{
|
||||
int t;
|
||||
t= *a;
|
||||
@ -9,7 +9,7 @@ void swap (int *a,int *b)
|
||||
|
||||
}
|
||||
|
||||
void merge(int a[],int l,int r,int n)
|
||||
void merge(int a[],int l,int r,int n)//To merge //
|
||||
{ int *b = (int*)malloc(n*sizeof(int));
|
||||
int c=l;
|
||||
int p1,p2;
|
||||
@ -64,7 +64,7 @@ void mergesort(int a[],int n,int l,int r)
|
||||
}
|
||||
|
||||
}
|
||||
int main(void) {
|
||||
int main(void) { //main function//
|
||||
int *a,n,i;
|
||||
scanf("%d",&n);
|
||||
a = (int*)malloc(n*sizeof(int));
|
||||
|
Loading…
Reference in New Issue
Block a user