Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
7250db2
Merge pull request #62 from swaaz/swaaz
swaaz Apr 28, 2020
563011f
javascript programs
mgeethabhargava Sep 25, 2020
ddfdff3
Merge pull request #66 from Mgeethabhargava/master
swaaz Sep 26, 2020
8bfab38
Merge pull request #67 from swaaz/hacktoberfest
swaaz Sep 26, 2020
4cfdaf3
remove binaries and IDE files; rename files properly
Sep 26, 2020
6fa08a0
fix compiler warnings
Sep 26, 2020
4e589a5
Merge pull request #68 from dk5ee/hacktoberfest
swaaz Sep 26, 2020
84977cb
Added program for kaprekar number
sajidmansoori12 Sep 30, 2020
a69401e
Added program for kaprekar number
sajidmansoori12 Sep 30, 2020
f0a12a7
Added a program in java
Vaidehi0421 Sep 30, 2020
3a0002e
Created MinMax
jainvaidehi Sep 30, 2020
7b7ad2e
Created README
jainvaidehi Sep 30, 2020
eb6ce96
Created program.c
shreetanu Sep 30, 2020
5c860fc
Added program in C
Vaidehi0421 Sep 30, 2020
3516c44
Created Readme.md
shreetanu Sep 30, 2020
4500f8c
Update Readme.md
shreetanu Sep 30, 2020
4572cfb
Created program
jainvaidehi Sep 30, 2020
3f83d6e
Created README
jainvaidehi Sep 30, 2020
c69856b
Create program.c
shreetanu Sep 30, 2020
3ea790d
Create Readme.md
shreetanu Sep 30, 2020
47eed1d
Created program
jainvaidehi Sep 30, 2020
80a5873
Created README
jainvaidehi Sep 30, 2020
d6c12f3
Added a program in C
Vaidehi0421 Sep 30, 2020
ee3f4fb
Create program.c
shreetanu Sep 30, 2020
64fe9d8
Created program
jainvaidehi Sep 30, 2020
acf8e04
Created README
jainvaidehi Sep 30, 2020
84b44ee
Added a program in C
Vaidehi0421 Sep 30, 2020
3927675
Create program.c
shreetanu Sep 30, 2020
ea5fdeb
Create Readme.md
shreetanu Sep 30, 2020
881fab4
Add program-55
claudiojpaz Oct 1, 2020
65ed8e3
new javascript programs
mgeethabhargava Oct 1, 2020
3bce936
Update program.c
aaarif796 Oct 1, 2020
70e4415
Delete a.out
aaarif796 Oct 1, 2020
5797178
Create readme.txt
aaarif796 Oct 1, 2020
b451c34
Merge pull request #69 from sajidmansoori12/kaprekar
swaaz Oct 1, 2020
1ad3317
Merge pull request #70 from Vaidehi0421/b1
swaaz Oct 1, 2020
9631ce2
Merge pull request #88 from swaaz/hacktoberfest
swaaz Oct 1, 2020
f34bd9a
Merge pull request #71 from jainvaidehi/Branch-1
swaaz Oct 1, 2020
72e5298
Merge pull request #73 from shreetanu/branchT-1
swaaz Oct 1, 2020
5cbd1c1
Merge pull request #74 from jainvaidehi/BranchVV-1
swaaz Oct 1, 2020
c6cea93
Merge pull request #75 from shreetanu/branchT-2
swaaz Oct 1, 2020
6bcdc54
Merge pull request #76 from jainvaidehi/Branch-VV-2
swaaz Oct 1, 2020
e391f38
Add files via upload
Arceus-sj Oct 1, 2020
2b3464c
Create README.md
Vaidehi0421 Oct 1, 2020
40dd6ac
Create Readme.md
Arceus-sj Oct 1, 2020
9a91028
Rename C++/Readme.md to C++/Program-2/Readme.md
Arceus-sj Oct 1, 2020
7751e09
Rename C++/number_of_occurrence.cpp to C++/Program-2/number_of_occurr…
Arceus-sj Oct 1, 2020
ad78aa2
Merge pull request #77 from Vaidehi0421/b4
swaaz Oct 1, 2020
edee3fd
Merge pull request #90 from swaaz/hacktoberfest
swaaz Oct 1, 2020
35c74a7
Merge pull request #78 from shreetanu/branchT-3
swaaz Oct 1, 2020
9ba9f9d
Merge pull request #79 from jainvaidehi/Branch-VV3
swaaz Oct 1, 2020
c1984c6
Merge pull request #72 from Vaidehi0421/b3
swaaz Oct 1, 2020
426b644
Merge pull request #81 from shreetanu/branchT-4
swaaz Oct 1, 2020
0291b9d
Merge pull request #91 from swaaz/hacktoberfest
swaaz Oct 1, 2020
4ba2b5d
Create swap_kth_Element.cpp
Arceus-sj Oct 1, 2020
56aabbf
Create Readme.md
Arceus-sj Oct 1, 2020
532e706
Merge pull request #82 from claudiojpaz/32bits-binary
swaaz Oct 1, 2020
d210397
Merge pull request #83 from Mgeethabhargava/master
swaaz Oct 1, 2020
3597979
Update and rename C/program-51/README.md to C/program-56/README.md
Vaidehi0421 Oct 1, 2020
a2e6bb6
Merge pull request #1 from Vaidehi0421/Vaidehi0421-patch-1
Vaidehi0421 Oct 1, 2020
edf67fd
Rename C/program-51/program.c to C/program-56/program.c
Vaidehi0421 Oct 1, 2020
92ba9ab
Merge pull request #85 from aaarif796/master
swaaz Oct 1, 2020
eb99810
Added sorting algorithm
Oct 1, 2020
a6761cc
Merge pull request #80 from Vaidehi0421/b5
swaaz Oct 1, 2020
e924e06
Merge pull request #93 from swaaz/hacktoberfest
swaaz Oct 1, 2020
6ac10f9
Merge pull request #89 from Arceus-sj/master
swaaz Oct 1, 2020
d9c3234
Merge pull request #92 from weeeihan/master
swaaz Oct 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions C++/Program -1/Program.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <iostream>
using namespace std;
#include<bits/stdc++.h>
int main() {
cout<<"Enter the number of elements "<<endl;
int n;
cin>>n;//Input the size of array
int arr[n];
int min=INT_MAX;
int max=INT_MIN;
cout<<"Enter the elements"<<endl;
for(int i=0;i<n;++i)//Input the elements of array
{
cin>>arr[i];
if(arr[i]<min)//if current element is less than min
min=arr[i];//min is updated
if(arr[i]>max)//if current element is greater than max
max=arr[i];//max is updated
}
cout<<"Minimum element is:"<<min<<endl;
cout<<"Maximum element is:"<<max<<endl;
return 0;
}
9 changes: 9 additions & 0 deletions C++/Program -1/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Program 1

Write a program to find the maximum and minimum element in an array.

Variable description--
n=Number of elements in an array
arr=Array of size n
min= Holds the minimum element
max=Holds the maximum element
7 changes: 7 additions & 0 deletions C++/Program-2/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Program 2:

Write a Program to find the number of occurrence of X element present in sorted array.
Variable description-->
n = size of array/ number of element
x = Element to be counted in array
count = veriable to count the X-number in array
42 changes: 42 additions & 0 deletions C++/Program-2/number_of_occurrence.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#include<bits/stdc++.h>

using namespace std;

class Solution{
public:

/*
if x is present in arr[] then returns the count
of occurrences of x, otherwise returns 0.
*/

int count(int arr[], int n, int x) {

int count = 0;
for(int i=0;i<n;i++){
if(arr[i] == x){
count++;
}
}
return count;
}
};



int main() {

int n, x;
cout<<"Enter the size of an Array: ";
cin >> n ;
cout<<"Enter a number to be counted: ";
cin>>x;
int arr[n];
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
Solution ob;
auto ans = ob.count(arr, n, x);
cout<< "number "<<x<<" counted in array for " << ans <<" times."<< "\n";
return 0;
}
4 changes: 4 additions & 0 deletions C++/Program-3/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Program to Swap the Kth Elements of a series.
variable description -->
n = number of elements/size
k = Kth element for swaping
45 changes: 45 additions & 0 deletions C++/Program-3/swap_kth_Element.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#include<iostream>

using namespace std ;

void takeInput(int a[], int n){
for(int i=1;i<=n;i++){
cin>>a[i];
}
}

void swap_k(int a[], int n, int k){

int i , count = n ;
for(i=1 ; i<=n , count >= 1 ; i++ , count--){

if(k == i || k == count){
swap(a[k],a[count]);
}

}

for(i=1;i<=n;i++){
cout<<a[i]<<" " ;
}
}

int main()
{

int n;
cout<<"Enter size of an Array:";
cin>>n ;

int k;
cout<<"Enter Kth element to swap:";
cin>>k ;

int a[1000];
takeInput(a,n);

swap_k(a,n,k);
cout<<"\n";

return 0;
}
8 changes: 8 additions & 0 deletions C/Program-49/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Program 49

Write a program to find the sum of the digits of the given number.

Variable description--
num=Number
sum= Holds the sum
dig=Holds the single digit of the number
18 changes: 18 additions & 0 deletions C/Program-49/program.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <stdio.h>

int main() {

int n;
printf("Enter the number");
int num;
scanf("%d",&num);//Enter the number
int sum=0,dig=0;
while(num>0)
{
dig=num%10;
sum+=dig;
num/=10;
}
printf("The sum of digits of a number is: %d",sum);
return 0;
}
4 changes: 4 additions & 0 deletions C/Program-52/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Program 52

Write a program to find whether the given element is present in the array or not.

39 changes: 39 additions & 0 deletions C/Program-52/program.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#include <stdio.h>

int main() {
int n;//number of elements of array;
printf("Enter the number of elements");
scanf("%d",&n);
int arr[n];
printf("\nEnter the elements");
for(int i=0;i<n;i++)
scanf("%d",&arr[i]);
int x;
printf("\nEnter the key to search");
scanf("%d",&x);
int l=0,r=n-1,m=0;
int f=1;
while (l <= r)
{
m = l + (r - l) / 2;

// Check if x is present at mid
if (arr[m] == x)
{
printf("\nElement found");
f=0;
break;
}

// If x greater, ignore left half
if (arr[m] < x)
l = m + 1;

// If x is smaller, ignore right half
else
r = m - 1;
}
if(f==1)
printf("\nElement not found");
return 0;
}
1 change: 1 addition & 0 deletions C/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
| Program-44 | Program for implementation of the approach |
| Program-45 | Program to illustrate the above given pattern of numbers. |
| Program-46 | Program to convert binary number to decimal |
| Program-47 | Program to print kaprekar number in a given range |



Binary file removed C/program-1/a.out
Binary file not shown.
Binary file removed C/program-15/a.out
Binary file not shown.
45 changes: 0 additions & 45 deletions C/program-16/.vscode/launch.json

This file was deleted.

Binary file removed C/program-16/a.out
Binary file not shown.
Binary file removed C/program-17/a.out
Binary file not shown.
4 changes: 2 additions & 2 deletions C/program-18/program.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ int main()
c=c+(a*a*a);
}
if(temp==c)
printf("armstrong number");
printf("armstrong number\n");
else
println("Not armstrong number");
printf("Not armstrong number\n");
return 0;
}
Binary file removed C/program-19/a.out
Binary file not shown.
8 changes: 4 additions & 4 deletions C/program-2/program.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ return 1;
int main() /*main function */
{
int n;
printf("enter the number");
printf("Enter the number:");
scanf("%d",&n);
if(isprime(n)==0)
{
printf(" not prime");
printf("%d is not prime number.",n);
}
else if(isprime(n)==1)
{
printf("prime");
printf("%d is a prime number.",n);
}
return 0;
}
}
Binary file removed C/program-20/a.out
Binary file not shown.
Binary file removed C/program-21/a.out
Binary file not shown.
Binary file removed C/program-22/a.out
Binary file not shown.
Binary file removed C/program-23/a.out
Binary file not shown.
Binary file removed C/program-24/a.out
Binary file not shown.
Binary file removed C/program-25/a.out
Binary file not shown.
6 changes: 6 additions & 0 deletions C/program-25/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This program is to print the number of *. Example if user enter 5. Then it'll print
*
**
***
****
*****
Binary file removed C/program-26/a.out
Binary file not shown.
Binary file removed C/program-27/a.out
Binary file not shown.
Binary file removed C/program-28/a.out
Binary file not shown.
Binary file removed C/program-29/a.out
Binary file not shown.
Binary file removed C/program-30/a.out
Binary file not shown.
Binary file removed C/program-31/a.out
Binary file not shown.
8 changes: 4 additions & 4 deletions C/program-31/program.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ int main()
{
printf("Enter the details of student - %d\n",i);
printf("Enter the name of the student\n");
scanf("%s",&stud[i].n);
scanf("%s",stud[i].n);
printf("Enter USN\n");
scanf("%s",&stud[i].u);
scanf("%s",stud[i].u);
printf("Enter total marks\n");
scanf("%d",&stud[i].m);
}
Expand All @@ -27,9 +27,9 @@ int main()
}
printf("Enter the details of new student\n");
printf("Enter the name\n"); //preferred to enter equal length of name
scanf("%s",&stud2.n);
scanf("%s",stud2.n);
printf("Enter the USN\n");
scanf("%s",&stud2.u);
scanf("%s",stud2.u);
printf("Enter the marks\n");
scanf("%d",&stud2.m);
printf("enter position\n");
Expand Down
6 changes: 3 additions & 3 deletions C/program-32/program.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ int m;
}stud[10],stud2;
int main()
{
int n,i,p=0;
int n,i=0;
printf("Enter the number of student\n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("Enter the details of student - %d\n",i);
printf("Enter the name of the student\n");
scanf("%s",&stud[i].n);
scanf("%s",stud[i].n);
printf("Enter USN\n");
scanf("%s",&stud[i].u);
scanf("%s",stud[i].u);
printf("Enter total marks\n");
scanf("%d",&stud[i].m);
}
Expand Down
5 changes: 3 additions & 2 deletions C/program-33/program.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* Arithematic operation using pointers */
#include <stdio.h>
void main()
#include <stdlib.h>
int main()
{
int a,b;
int *x,*y;
Expand All @@ -9,6 +10,6 @@ x=&a;
y=&b;
//s=;
printf("%d\t%d",*x+*y,abs(*x-*y));

return 0;
}

Binary file removed C/program-37/a.out
Binary file not shown.
6 changes: 2 additions & 4 deletions C/program-37/program.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ int f;

if(n==0 || n==1)
{

return ;
return 1;
}
else
{
f=fib(n-2)+fib(n-1);
}


return f;
}

int main()
Expand Down
Binary file removed C/program-38/a.out
Binary file not shown.
6 changes: 2 additions & 4 deletions C/program-38/program.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ int f;

if( n==1)
{

return ;
return 1;
}
else
{
f=n*fact(n-1);
}


return f;
}

int main()
Expand Down
Binary file removed C/program-39/a.out
Binary file not shown.
Loading