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
17 changes: 15 additions & 2 deletions C/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,20 @@
| 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 |

| Program-47 | Program to find the maximum and minimum element in an array|
| Program-48 | Program to check if a number is even or odd |
| Program-49 | Program to find the sum of the digits of the given number |
| Program-50 | Program to check whether a given number is a palindrome or not |
| Program-51 | Program to print duplicates in an array |
| Program-52 | to find whether the given element is present in the array or not |
| Program-53 | Program to find the position of an element in an array |
| Program-54 | Program to check whether two strings are anagrams or not |
| Program-55 | Program to print print a number in binary |
| Program-56 | Program to calculate the number of vowels and consonants in a string |
| Program-57 | Program to calculate the grade |
| Program-58 | Program to find the sum of elements between indexes |
| Program-59 | Program to Search Students details in a list |
| Program-60 | Program to print kaprekar number in a given range |



File renamed without changes.
33 changes: 33 additions & 0 deletions C/program-47/program 47.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include <time.h>
#include <stdio.h>
#include <stdlib.h>

int main()
{
/* Length of the password */
int length;
int num;
int temp;
printf("Enter the length of the password: ");
scanf("%d", &length);
printf("\nEnter the number of passwords you want: ");
scanf("%d", &num);
/* Seed number for rand() */
srand((unsigned int) time(0) + getpid());

while(num--)
{
temp = length;
printf("\n");
while(temp--) {
putchar(rand() % 56 + 65);
srand(rand());
}

temp = length;
}

printf("\n");

return EXIT_SUCCESS;
}
1 change: 1 addition & 0 deletions C/program-53/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Program to find the position of an element in an array
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions C/program-58/Program.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include<stdio.h>
void main()

{
//float n[10];
int i,sum,a,b,x;
printf("enter the size of elements\n");
scanf("%d", &x);
float n[x];
printf("enter the values\n");
for (i=0;i<x;i++)
{
scanf("%f", &n[i]);
}
printf("enter the indexes to be added\n" );
scanf("%d%d", &a, &b);
sum=0;
for (;a<=b;a++)
{
sum = sum + n[a];
}

printf("\nThe sum of elements between the indexes is %d", sum);
}
4 changes: 4 additions & 0 deletions C/program-58/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Program 58


Write a program to find the sum of elements between indexes
64 changes: 64 additions & 0 deletions C/program-59/program.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#include<stdio.h>
#include<string.h>

typedef struct student
{

char name[25];
char usn[15];
float cgpa;
} S;
S s[70];


void search(char name[],int n)
{

int i,j;
// printf("%s\n",name);
for(i=0;i<n;i++)
{
if (strlen(name)==strlen(s[i].name))
{
for (j = 0; j < n; j++)
{
// printf("%s\n", s[i].name);
if(name[j]=name[j]) printf("Name: %s\nUSN: %s\nCGPA: %f\n", s[i].name, s[i].usn,s[i].cgpa);
break;
}
}
}
}

int main ()
{
int i,a,b, n;
char name[10];

printf ("*Enter student details**\n");
printf ("Enter number of students\n");
scanf ("%d", &n);
for (i = 0; i < n; i++)
{
printf ("Enter name\n");
scanf ("%s", s[i].name);
printf ("Enter USN\n");
scanf ("%s", s[i].usn);
printf ("Enter CGPA\n");
scanf ("%f",&s[i].cgpa);
}
for (i = 0; i < n; i++)
{
printf ("**Student details**\n");
printf ("Name: %s\tUSN: %s\tCGPA: %f\n", s[i].name, s[i].usn, s[i].cgpa);
}

printf ("*Search by name*\n");
printf ("enter the name\n");
scanf ("%s", name);
// printf("%s\n", name);
// name = s[i].name;
search(name,n);

}

4 changes: 4 additions & 0 deletions C/program-59/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Program 59


Write a program to Search Students details in a list
File renamed without changes.
4 changes: 4 additions & 0 deletions C/program-60/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Program 59


Write a program to print kaprekar number in a given range
9 changes: 9 additions & 0 deletions Java/program-2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Program 2

Given a String,check if it is a palindrome or not.

Variable description
s= Input String
start= Starting index of String s
end= Last index of String s
flag= Variable to mark if the String is not a Palindrome
26 changes: 26 additions & 0 deletions Java/program-2/program.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import java.io.*;
import java.util.*;
class prg{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
String s=sc.next();
int start=0;
int end=s.length()-1;
int flag=0;
while(start<end)
{
if(s.charAt(start)!=s.charAt(end))
{
flag=1;
break;
}
start++;
end--;
}
if(flag==1)
System.out.println("Given string is not a Palindrome");
else
System.out.println("Given string is a Palindrome");
}
}
47 changes: 47 additions & 0 deletions Javascript/program-5/program-5.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<html>
<head>
<title>MATHEMATICAL OPERATIONS OF TWO NUMBERS</title>
<script type="text/javascript">
function add()
{
var a=document.getElementById("n1").value;
var b=document.getElementById("n2").value;
var c=parseInt(a)+parseInt(b);
document.getElementById("Results").value=c;
}
function sub()
{
var a=document.getElementById("n1").value;
var b=document.getElementById("n2").value;
var c=parseInt(a)-parseInt(b);
document.getElementById("Results").value=c;
}
function mul()
{
var a=document.getElementById("n1").value;
var b=document.getElementById("n2").value;
var c=parseInt(a)*parseInt(b);
document.getElementById("Results").value=c;
}
function div()
{
var a=document.getElementById("n1").value;
var b=document.getElementById("n2").value;
var c=parseInt(a)/parseInt(b);
document.getElementById("Results").value=c;
}
</script>
<body>
<form>
ENTER NUMBER1:<input type="text" id="n1" size="20"/><br>
ENTER NUMBER2:<input type="text" id="n2" size="20"/><br>
<input type="button" value="+" onclick="add()"/>
<input type="button" value="-" onclick="sub()"/>
<input type="button" value="*" onclick="mul()"/>
<input type="button" value="/" onclick="div()"/>
Reset:<input type="Reset" value="Reset"/>
Result:<input type="text" id="Results"/>
</form>
</body>
</html>

4 changes: 4 additions & 0 deletions Javascript/program-5/read.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Program-5
## This is a javascript program for mathematical operations


17 changes: 17 additions & 0 deletions Javascript/program-6/program-6.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<html>
<head>
<title> CHARACTER PROCESSING METHODS</title>
<Script type="text/javascript">
var s="ZEBRA";
var s2="AbCdEfG";
document.writeln("<p>Character at index 0 in"+s+" is"+s.charAt(0));
document.writeln("<br/>character code at index 0 in "+s+" is"+s.charCodeAt(0));
document.writeln("<p> "+s2+" in lower case is"+s2.toLowerCase());
document.writeln("<br/>"+s2+"in upper case is"+s2.toUpperCase());
document.writeln("<p>"+String.fromCharCode(87,79,82,68)+" contains character codes 87,79,82,68."+"</p>");

</script>
</head>
<body>
</body>
</html>
3 changes: 3 additions & 0 deletions Javascript/program-6/read.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Program-4
## This is a javascript program for character processing

9 changes: 9 additions & 0 deletions Python/program-4/Program 4.py
Original file line number Diff line number Diff line change
@@ -0,0 +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))