Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Javascript/program-6/read.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Program-4
# Program-6
## This is a javascript program for character processing

33 changes: 33 additions & 0 deletions Javascript/program-7/program-7.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<html>
<head>
<title>Searching strings with index Of amd LastIndex of</title>

<script type="text/javascript">
var l="abcdefghijklmnopqrstuvwxzabcdefghijklm"
function buttonPressed()
{

sForm.first.value=l.indexOf(sForm.inputVal.value);
sForm.last.value=l.lastIndexOf(sForm.inputVal.value);
sForm.firstl2.value=l.indexOf(sForm.inputVal.value,12);
sForm.lastl2.value=l.lastIndexOf(sForm.inputVal.value,12);
}
</script>
</head>
<body>
<form name="sForm" action="">
<h1>The String to search is:</br>abcdefghijklmnopqrstuvwxyzabcdefghijklm</h1>
<p>Enter substring to search for
<input name="inputVal" type="text"/>
<input name="search" type="button" value="search" onclick="buttonPressed()"/><br/></p>
<p>First Occurace located at index
<input name="first" type="text" size="5"/>
<br/>Last occurance located at index
<input name="last" type="text" size="5"/>
<br/>First occurance from index l2 located at index
<input name="firstl2" type="text" size="5"/>
<br/>last occurance from index l2 located at index
<input name="lastl2" type="text" size="5"/></p>
</form>
</body>
</html>
4 changes: 4 additions & 0 deletions Javascript/program-7/read.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Program-7

## This is a javascript program for string searching

21 changes: 21 additions & 0 deletions Javascript/program-8/program-8.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Welcome to Javacsript!";
}
</script>
</head>

<body>

<p>When you click "Try it", a function will be called.</p>
<p>The function will display a message.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

</body>
</html>
4 changes: 4 additions & 0 deletions Javascript/program-8/read.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Program-8

## This is a javascript program for javascript function basic program

7 changes: 0 additions & 7 deletions Python/Program-3/README.md

This file was deleted.

24 changes: 24 additions & 0 deletions Python/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Python-basicprograms
## This repo contains basics programs in Python programming language.
| Program No.| Question |
| ------- | ------ |
| Program-01 | Program to print Hello World. |
| Program-02 | Program to find the factorial of a number. |
| Program-03 | Program to find if the string is Palindrom or not. |
| Program-04 | Program to find sum of two numbers. |
| Program-05 | Program to print a pattern. |
| Program-06 | Program to print a pattern. |
| Program-07 | Program to print a pattern. |
| Program-08 | Program to print a pattern. |
| Program-09 | Program to check if he number is armstrong or not. |
| Program-10 | Program to shuffle a deck of cards. |
| Program-11 | Program to print fibonacci series. |
| Program-12 | Program to check if a number is prime or not. |
| Program-13 | Program to find a number in an array using binary search. |
| Program-14 | Program to find simple interest for given principal amount, time and rate of interest. |
| Program-15 | Program to sort the array and give the time to sort the array. |
| Program-16 | Program to print a right angled triangle. |




File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion Python/program-18/git3.py → Python/program-14/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# for given principal amount, time and
# rate of interest.


def simple_interest(p,t,r):
print('The principal is', p)
print('The time period is', t)
Expand Down
1 change: 0 additions & 1 deletion Python/program-14/readme.md

This file was deleted.

File renamed without changes.
1 change: 0 additions & 1 deletion Python/program-15/readme.md

This file was deleted.

6 changes: 3 additions & 3 deletions Python/program-4/triangle.py → Python/program-16/program.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
for i in range(5):
for j in range(i):
print('*', end=' ')
for i in range(5):
for j in range(i):
print('*', end=' ')
print()
1 change: 0 additions & 1 deletion Python/program-18/readme.md

This file was deleted.

15 changes: 14 additions & 1 deletion Python/program-2/program.py
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
print("Hello, World!")
fact=int(input("input any number"))
# input any number
factorial = 1
#predefined factorial of 0
if fact < 0:
print("factorial is not possible")
elif fact == 0:
print("factorial of "+str(fact) +" is "+str(factorial))
else:
fact1=fact
while(fact>2):
fact-=1
fact1=fact1*(fact)
print("factorial is "+ str(fact1))
2 changes: 0 additions & 2 deletions Python/program-4/README.md

This file was deleted.

18 changes: 9 additions & 9 deletions Python/program-4/Program 4.py → Python/program-4/program.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Store input numbers
num1 = input('Enter first number: ')
num2 = input('Enter second number: ')
# Add two numbers
sum = float(num1) + float(num2)
# Display the sum
print('The sum of {0} and {1} is {2}'.format(num1, num2, sum))
# Store input numbers
num1 = input('Enter first number: ')
num2 = input('Enter second number: ')

# Add two numbers
sum = float(num1) + float(num2)

# Display the sum
print('The sum of {0} and {1} is {2}'.format(num1, num2, sum))
9 changes: 6 additions & 3 deletions Python/program-5/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
Program 5

Write a program to find a factorial of a number.
This program gives the following pattern:

Variable description--
fact= Holds the input number
1
1 2 1 2
1 2 3 1 2 3
1 2 3 4 1 2 3 4
1 2 3 4 5 1 2 3 4 5

14 changes: 0 additions & 14 deletions Python/program-5/factorial.py

This file was deleted.

File renamed without changes.
9 changes: 6 additions & 3 deletions Python/program-6/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
Program 6

Write a program to check whether a number is prime or not
The code gives the following pattern :

Variable description--
n= holds input value
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5

4 changes: 0 additions & 4 deletions Python/program-6/pattern.py

This file was deleted.

18 changes: 4 additions & 14 deletions Python/program-6/program.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
n=int(input("enter any number"))
# n is the number to check whether it is prime or not
if n>1:
# loop from 2 to n/2
for i in range(2,int(n/2)):

if(n%i)==0:
#if n is completly divisible by i then it is not a prime number
print("n is not prime")
break
else:
print("n is prime")
else:
print("not prime")
for i in range(1,6):
for j in range(1,i+1):
print(i,end=' ')
print()
File renamed without changes.
File renamed without changes.
File renamed without changes.