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
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.
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.
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.
3 changes: 1 addition & 2 deletions C/program-39/program.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Program to find the GCD of a number using recursion

int gcd(int a,int b)
{
int f;

if( b!=0)
{
Expand All @@ -16,7 +15,7 @@ int f;
}
else
{
return;
return a;
}


Expand Down
3 changes: 2 additions & 1 deletion C/program-40/program.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ int ack(int m,int n)
else if(m!=0 && n==0)
return ack(m-1,1);
else if (m!=0 && n!=0)
return ack(m-1,ack(m,n-1));
return ack(m-1,ack(m,n-1));
return 0;
}

int main()
Expand Down
2 changes: 1 addition & 1 deletion C/program-42/program42.c → C/program-42/program.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*C Program to print Floyd’s triangle*/
// Without using a temporary variable and with only one loop
#include<stdio.h>
void floyd(n){
void floyd(int n){
int i,j=1;
for (i=1;i<=(n*(n+1))/2;i++){
printf("%d ",i);
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion C/program-44/program.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Alphabet Z Pattern
void alphabet_Z_Pattern(int N)
{
int index, side_index, size;
int index, side_index;

// Declaring the values of Right,
// Left and Diagonal values
Expand Down
9 changes: 9 additions & 0 deletions Java/program-1/README.md
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
24 changes: 24 additions & 0 deletions Java/program-1/program.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import java.util.*;
import java.io.*;

class prg {
public static void main (String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("Enter the size of array");
int N=sc.nextInt();
int arr[]=new int[N];
System.out.println("Enter the elements in the array");
for(int i=0;i<N;i++)
arr[i]=sc.nextInt();
int min=arr[0]; // Assuming first element to be the minimum
int max=arr[0]; // Assuming first element to be the maximum
for(int i=1;i<N;i++)
{
if(arr[i]<min)
min=arr[i];
if(arr[i]>max)
max=arr[i];
}
System.out.println("Minimum="+min+"\nMaximum="+max);
}
}