Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ambujraj authored Oct 1, 2018
2 parents a64e7ca + f9cc2f4 commit 53c481e
Show file tree
Hide file tree
Showing 56 changed files with 1,146 additions and 30 deletions.
Binary file added .DS_Store
Binary file not shown.
19 changes: 19 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@

Name: Tanuj Rohilla
Place: Delhi
About: I am 1st year Msc Computer Science, University of Delhi
Programming Language: c, c++, java, python

Name: [Aditya Agarwal](https://github.com/aditya81070)
Place: Jaipur, Rajasthan
About: I am 3rd year computer science student at Jecrc foundation, Jaipur. I am a front end developer.
Programming Languages: C, C++, Python, Javascript
Email: [email protected]

Name: [Sarabjeet Singh](https://github.com/singh-sarabjeet)
Place: Bangalore, India<br/>
About: I'm a full stack developer currently working at PowerSchool India <br/>
Programming Languages: C, Java, Python, Javascript <br/>
Email: [email protected]


Name: [Vaibhav Khandelwal](https://github.com/Vaibzz)
About: I am a computer science undergraduate from VIT University, Vellore. I am a competitive programmer by passion. My other areas of interest include Data Analysis and visualization, Backend Development and Machine Learning.
Programming Language: Cpp, C, R, PHP, HTML, CSS <br/>
Email: [email protected]
12 changes: 12 additions & 0 deletions Factorial.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* create a factorial function for long integers*/
#include <iostream.h>
using namespace std;
int main(){
int i,n;
unsigned long long fact=1;// gives factorial of large numbers
cin>>n;
for(i=1;i<=n;i++){
fact =fact *i;
}
cout<<fact<<endl;
}
23 changes: 23 additions & 0 deletions Fibonacci.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* A program to form a fibonacci series */
#include <iostream.h>
using namespace std;

int main(int argc, char const *argv[])
{
int nc,count=0,sum;
int first,second;
cout<<"enter the no. of terms"<<endl;
cin>>nc;
cout<<"enter the first number"<<endl;
cin>>first;
cout<<"enter the second number"<<endl;
cin>>second;
while(count<nc){
sum=first+second;
cout<<sum<<endl;
first=second;
second=sum;
count++;
}
return 0;
}
15 changes: 15 additions & 0 deletions Palindrome.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include <iostream>
using namespace std;
int main()
{
int n,remainder,reverse=0,originalnumber;
cin>>n;
originalnumber=n;
while(n!=0){
remainder = n%10;
reverse=reverse*10 +remainder;
n/=10;
}
(originalnumber==reverse)?cout<<"palindrome":cout<<"not palindrome";
return 0;
}
16 changes: 16 additions & 0 deletions Pallindrome.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#python3
/*

Made By: Keshav Gupta
7:35 PM
*/

# main method

print("Enter the string to check")
t=input()

if(t==t[::-1]):
print("The string entered is pallindrome")
else:
print("Not a pallindrome")
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@
<br><br>You can check your progress of HacktoberFest at <a target="_blank" href="https://hacktoberfest.digitalocean.com/stats/">this link</a>.

## Getting Started

* Add Your Name to the CONTRIBUTORS.md file using following model
```markdown
Name: [YOUR NAME](Github Link)
Place: city you belong to
About: Short Intro
Programming Language: Which programming language do you know
Email:
```
* Fork this repository (Click the Fork button in the top right of this page, click your Profile Image)
* Clone your fork down to your local machine
```markdown
git clone https://github.com/ambujraj/hacktoberfest2018.git
git clone https://github.com/your-username/hacktoberfest2018.git
```
* Create a branch
```markdown
Expand Down
25 changes: 25 additions & 0 deletions armstrong.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*A program to find the armstrong of a number*/

#include <iostream.h>
#include <math.h>
using namespace std;

int main(){
int number, originalnumber, remainder,result=0,n=0;
cout<<"enter a number"<<endl;
cin>>number;
originalnumber = number;
while(originalnumber!=0){
originalnumber/=10;
++n;
}
originalnumber=number;
while(originalnumber!=0){
remainder=originalnumber%10;
result+=pow(remainder,n);
originalnumber/=10;
}
(result==number)?cout<<"armstrong":cout<<"not armstrong";
return 0;
}

9 changes: 4 additions & 5 deletions call-by-reference/callbyreference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
using namespace std;
void swap(int &a, int &b)
{
int temp;
temp = a;
a = b;
b = temp;
a^=b;
b^=a;
a^=b;

return;
}
Expand All @@ -21,4 +20,4 @@ int main () {
cout << "After swap, value of b :" << y << endl;

return 0;
}
}
22 changes: 22 additions & 0 deletions css/arrow.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
body {
height: 100%;
width: 100%;
background-color: #333;
color: white;
font-size: 20px;
font-family: 'sans-serif';
}

.h1 {
position: relative;
}

/* -- Arrow -- */

.arrow-1 {
height: 20px;
width: 20px;
border: 3px solid pink;
border-width: 3px 3px 0 0;
transform: rotate(45deg);
}
15 changes: 15 additions & 0 deletions css/arrow.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>

<html lang="en">

<head>
<meta charset="utf-8">
<link rel="stylesheet" href="arrow.css">
</head>
<h1>Arrow</h1>

<body>
<div class="arrow-1"></div>
</body>

</html>
34 changes: 34 additions & 0 deletions css/basic.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>

<html lang="en-US">


<head>
<title>HomePage</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="styles.css">
<meta name="description" content="basic webpage">
<meta name="keywords" content="basic, website">
<meta name="author" content="saish mhatre">
<base href="https://www.w3schools.com/images/" target="_blank">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>


<body>

<h1>
Welcome To My Landing Page.
</h1>

<ul>
<li> <a href="#Home">Home</a> </li>
<li> <a href="#News">News</a> </li>
<li> <a href="#About Us">About Us</a> </li>
<li> <a href="#Contact Us">Contact Us</a> </li>
</ul>



</body>
</html>
Binary file added css/landing.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions css/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@charset "UTF-8";
h1 {
text-align:center;
font-size:2vw;

}

ul {
list-style-type: none;
background-color:#333333;
padding:0;
margin:0;
overflow:hidden;

}

li {
float:left;
}

li a {
text-decoration: none;
display:block;
padding:18px;
color:white;
text-align: center;

}

li a:hover{
background-color:#111111;
}
body {
background-image:url(landing.jpeg);
}
12 changes: 12 additions & 0 deletions factorial/Factorial.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
public class Factorial {
static int factorial(int n) {
if (n == 0) {
return 1;
}
else {
return(n*factorial(n-1));
}
}
}


19 changes: 19 additions & 0 deletions factorial/Factorial_Num.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
created by: Keshav Gupta
7:27 PM
*/

# method to calculate factorial

def Facto(t):
i=1
for x in range(1,t+1):
i=i*x
print("factorial of ",t," is ",i)

# main method

print("Enter the nu,ber to find factorial")
t=int(input())
Facto(t)

10 changes: 10 additions & 0 deletions factorial/factorial.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class FactorialExample{
public static void main(String args[]){
int i,fact=1;
int number=5;//It is the number to calculate factorial
for(i=1;i<=number;i++){
fact=fact*i;
}
System.out.println("Factorial of "+number+" is: "+fact);
}
}
19 changes: 19 additions & 0 deletions factorial/factorials.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <iostream>

int factorial(int n)
{
if (n <= 1)
return 1;

else return n * factorial(n - 1);
}

int main()
{
std::cout << "Enter a number!: ";
int num;
std::cin >> num;
std::cout << num << "! = " << factorial(num) << std::endl;

return 0;
}
32 changes: 32 additions & 0 deletions fibonacci/fibonacci.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package main

import (
"fmt"
"strconv"
)

func fib(num int64) {
tmp := make([]int64, num)
for i := int64(0); i < num; i++ {
if i == 0 || i == 1 {
tmp[i] = i
} else {
tmp[i] = tmp[i-2] + tmp[i-1]
}
}

fmt.Print("The fibonnaci series is: ")
for _, item := range tmp {
fmt.Printf("%v ", item)
}
fmt.Println()
}

func main() {
fmt.Print("Enter the number of terms: ")
var input string
fmt.Scanln(&input)

num, _ := strconv.ParseInt(input, 10, 64)
fib(num)
}
Loading

0 comments on commit 53c481e

Please sign in to comment.