Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
621a5f1
"Issue 1 Resolved"
Oct 11, 2019
4684378
Issue Resoled
vinayak0505 Oct 12, 2019
c641fdf
hello world
Gaurav9876543210 Oct 12, 2019
69bc540
Added Print Func
1406-maker Oct 12, 2019
6caef7b
issue resolved
akashnagpal1123 Oct 12, 2019
c843e2b
Added Print Function
pranshukatyal14 Oct 12, 2019
df726dd
issue resolved
gauravv70 Oct 12, 2019
e7bc819
added function
muskgupta32 Oct 12, 2019
876c32f
Added Print Function
dilsheen16 Oct 12, 2019
c9a3365
Factorial of a number in C language
akashnagpal1123 Oct 12, 2019
4663a07
Factorial of a number using Recursion
akashnagpal1123 Oct 12, 2019
61e46f1
Added Pattern.cpp
Gaurav9876543210 Oct 12, 2019
32afe5a
create print pattern
muskgupta32 Oct 12, 2019
45590b0
added factorial.cpp
vinayak0505 Oct 12, 2019
d75dcc7
count.cpp
Gaurav9876543210 Oct 12, 2019
7f49119
create print pattern
muskgupta32 Oct 12, 2019
e0e91b0
sum.py
pranshukatyal14 Oct 12, 2019
3189285
Merge pull request #19 from pranshukatyal14/helloWorldNew
siddharthnarula Oct 12, 2019
26576de
Merge pull request #18 from vinayak0505/master
siddharthnarula Oct 12, 2019
ec4226e
Sum of digits of a number
akashnagpal1123 Oct 12, 2019
61731b7
Merge pull request #17 from Gaurav9876543210/master
siddharthnarula Oct 12, 2019
3a257d5
Fibonacci series
dilsheen16 Oct 12, 2019
59d00b3
sum of numbers
muskgupta32 Oct 12, 2019
ee8f214
Merge pull request #16 from akashnagpal1123/master
siddharthnarula Oct 12, 2019
47b3e8b
Merge branch 'master' into master
siddharthnarula Oct 12, 2019
06cc3f0
Merge pull request #14 from dilsheen16/master
siddharthnarula Oct 12, 2019
0446fbe
Merge branch 'master' into master
siddharthnarula Oct 12, 2019
e41114a
Merge pull request #13 from 1234-sketch/master
siddharthnarula Oct 12, 2019
3705b2f
Rename sum of numbers to sum of numbers.cpp
muskgupta32 Oct 12, 2019
45b76ec
Fibonacci series
dilsheen16 Oct 12, 2019
4d3b377
Rename create print pattern to createprintpattern.cpp
muskgupta32 Oct 12, 2019
0565e3d
patern.py
pranshukatyal14 Oct 12, 2019
2e471c8
patt.py
pranshukatyal14 Oct 12, 2019
b8f7207
Merge pull request #23 from dilsheen16/master
siddharthnarula Oct 12, 2019
21c42ed
Merge pull request #22 from 1234-sketch/patch-1
siddharthnarula Oct 12, 2019
acaf584
Merge branch 'master' into master
siddharthnarula Oct 12, 2019
4149626
Merge pull request #11 from pranshukatyal14/master
siddharthnarula Oct 12, 2019
10c8075
Merge branch 'master' into patch-1
siddharthnarula Oct 12, 2019
283e52d
Merge pull request #7 from vinayak0505/patch-1
siddharthnarula Oct 12, 2019
0d1ad0d
Merge pull request #21 from 1234-sketch/master
siddharthnarula Oct 12, 2019
ed5847a
Update print pattern
pranshukatyal14 Oct 12, 2019
ee6cf52
Merge pull request #24 from pranshukatyal14/patch-1
siddharthnarula Oct 12, 2019
e646163
Create multiplicationofnumbers.cpp
muskgupta32 Oct 12, 2019
7f1e7a0
Merge branch 'master' into patch-1
siddharthnarula Oct 12, 2019
2c2e942
Merge pull request #12 from gaurav-budhiraja/patch-1
siddharthnarula Oct 12, 2019
e65a069
Merge branch 'master' into patch-1
siddharthnarula Oct 12, 2019
13a9e1a
Merge pull request #10 from akashnagpal1123/patch-1
siddharthnarula Oct 12, 2019
5e65c5d
Merge pull request #25 from 1234-sketch/master
siddharthnarula Oct 12, 2019
1455ef0
Merge branch 'master' into patch-1
siddharthnarula Oct 12, 2019
8ab3b3f
Swapping Of elements using Call by reference
akashnagpal1123 Oct 12, 2019
e4f1c1e
Merge branch 'master' into patch-1
siddharthnarula Oct 12, 2019
4bc16e5
Merge pull request #8 from Gaurav9876543210/patch-1
siddharthnarula Oct 12, 2019
89e3d24
Merge pull request #9 from 1406-maker/patch-1
siddharthnarula Oct 12, 2019
12470c5
Merge pull request #26 from akashnagpal1123/patch-2
siddharthnarula Oct 12, 2019
bd1df13
Add files via upload
PRUBHTEJ Oct 12, 2019
eadc32f
Add files via upload
PRUBHTEJ Oct 12, 2019
287e636
Add files via upload
PRUBHTEJ Oct 12, 2019
77caf86
Add files via upload
PRUBHTEJ Oct 12, 2019
e9ebb11
Merge pull request #27 from PRUBHTEJ/master
siddharthnarula Oct 12, 2019
f2ea72c
Add files via upload
PRUBHTEJ Oct 12, 2019
0c37d3e
Merge pull request #28 from PRUBHTEJ/master
siddharthnarula Oct 12, 2019
ccb277a
Add files via upload
PRUBHTEJ Oct 12, 2019
5f97f78
Add files via upload
PRUBHTEJ Oct 12, 2019
79af868
Add files via upload
PRUBHTEJ Oct 12, 2019
afa446d
Merge pull request #29 from PRUBHTEJ/master
siddharthnarula Oct 12, 2019
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
86 changes: 86 additions & 0 deletions 11.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>

#define size 5
struct stack {
int s[size];
int top;
} st;

int stfull() {
if (st.top >= size - 1)
return 1;
else
return 0;
}

void push(int item) {
st.top++;
st.s[st.top] = item;
}

int stempty() {
if (st.top == -1)
return 1;
else
return 0;
}

int pop() {
int item;
item = st.s[st.top];
st.top--;
return (item);
}

void display() {
int i;
if (stempty())
printf("\nStack Is Empty!");
else {
for (i = st.top; i >= 0; i--)
printf("\n%d", st.s[i]);
}
}

int main() {
int item, choice;
char ans;
st.top = -1;

printf("\n\tImplementation Of Stack");
do {
printf("\nMain Menu");
printf("\n1.Push \n2.Pop \n3.Display \n4.exit");
printf("\nEnter Your Choice");
scanf("%d", &choice);
switch (choice) {
case 1:
printf("\nEnter The roll no to be pushed:");
scanf("%d", &item);
if (stfull())
printf("\nStack is Full!");
else
push(item);
break;
case 2:
if (stempty())
printf("\nEmpty stack!Underflow !!");
else {
item = pop();
printf("\nThe popped element is %d", item);
}
break;
case 3:
display();
break;
case 4:
exit(0);
}
printf("\nDo You want To Continue?");
ans = getche();
} while (ans == 'Y' || ans == 'y');

return 0;
}
85 changes: 85 additions & 0 deletions 13.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
//q 13
#include <stdio.h>



void insert();
void delete();
void display();
int queue_array[50];
int rear = - 1;
int front = - 1;
main()
{
int choice;
while (1)
{
printf("1.Insert employee numbers to queue \n");
printf("2.Delete employee numbers from queue \n");
printf("3.Display all employee numbers in queue \n");
printf("4.Quit \n");
printf("Enter your choice : ");
scanf("%d", &choice);
switch (choice)
{
case 1:
insert();
break;
case 2:
delete();
break;
case 3:
display();
break;
case 4:
exit(1);
default:
printf("Wrong choice \n");
} /* End of switch */
} /* End of while */
} /* End of main() */

void insert()
{
int add_item;
if (rear == 50 - 1)
printf("Queue Overflow \n");
else
{
if (front == - 1)
/*If queue is initially empty */
front = 0;
printf("Insert the employee number in queue : ");
scanf("%d", &add_item);
rear = rear + 1;
queue_array[rear] = add_item;
}
} /* End of insert() */

void delete()
{
if (front == - 1 || front > rear)
{
printf("Queue Underflow \n");
return ;
}
else
{
printf("Employee number deleted from queue is : %d\n", queue_array[front]);
front = front + 1;
}
} /* End of delete() */

void display()
{
int i;
if (front == - 1)
printf("Queue is empty \n");
else
{
printf("Queue is : \n");
for (i = front; i <= rear; i++)
printf("%d ", queue_array[i]);
printf("\n");
}
} /* End of display() */
14 changes: 14 additions & 0 deletions Factorial in C
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <stdio.h>

int factorial(int number)
{
if(number == 0){
return 1;
}
return number * factorial(number-1);
}

int main(){
printf("%d\n", factorial(10));
return 0;
}
14 changes: 14 additions & 0 deletions Factorial using recursion
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <stdio.h>

int factorial(int number)
{
if(number == 0){
return 1;
}
return number * factorial(number-1);
}

int main(){
printf("%d\n", factorial(10));
return 0;
}
25 changes: 25 additions & 0 deletions Pattern.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++){
//for ith row
for(int j=0;j<=i;j++){
cout<<"*";
}
cout<<" ";
for(int j=0;j<n-i;j++){
cout<<"*";
}
cout<<" ";
for(int j=0;j<n-i;j++){
cout<<"*";
}
cout<<" ";
for(int j=0;j<=i;j++){
cout<<"*";
}
cout<<endl;
}
}
138 changes: 138 additions & 0 deletions Q15.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
/* C Program to implement queue using circular linked list*/

#include<stdio.h>
#include<stdlib.h>

struct node
{
int info;
struct node *link;
}*rear=NULL;

void insert(int item);
int del();
void display();
int isEmpty();
int peek();

int main()
{
int choice,item;
while(1)
{
printf("\n1.Insert\n");
printf("2.Delete\n");
printf("3.Peek\n");
printf("4.Display\n");
printf("5.Quit\n");
printf("\nEnter your choice : ");
scanf("%d",&choice);

switch(choice)
{
case 1:
printf("\nEnter the element for insertion : ");
scanf("%d",&item);
insert(item);
break;
case 2:
printf("\nDeleted element is %d\n",del());
break;
case 3:
printf("\nItem at the front of queue is %d\n",peek());
break;
case 4:
display();
break;
case 5:
exit(1);
default:
printf("\nWrong choice\n");
}/*End of switch*/
}/*End of while*/
}/*End of main()*/

void insert(int item)
{
struct node *tmp;
tmp=(struct node *)malloc(sizeof(struct node));
tmp->info=item;
if(tmp==NULL)
{
printf("\nMemory not available\n");
return;
}

if( isEmpty() ) /*If queue is empty */
{
rear=tmp;
tmp->link=rear;
}
else
{
tmp->link=rear->link;
rear->link=tmp;
rear=tmp;
}
}/*End of insert()*/

del()
{
int item;
struct node *tmp;
if( isEmpty() )
{
printf("\nQueue underflow\n");
exit(1);
}
if(rear->link==rear) /*If only one element*/
{
tmp=rear;
rear=NULL;
}
else
{
tmp=rear->link;
rear->link=rear->link->link;
}
item=tmp->info;
free(tmp);
return item;
}/*End of del()*/

int peek()
{
if( isEmpty() )
{
printf("\nQueue underflow\n");
exit(1);
}
return rear->link->info;
}/* End of peek() */

int isEmpty()
{
if( rear == NULL )
return 1;
else
return 0;
}/*End of isEmpty()*/


void display()
{
struct node *p;
if(isEmpty())
{
printf("\nQueue is empty\n");
return;
}
printf("\nQueue is :\n");
p=rear->link;
do
{
printf("%d ",p->info);
p=p->link;
}while(p!=rear->link);
printf("\n");
}/*End of display()*/
12 changes: 12 additions & 0 deletions Q21.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# fibonacci series
num1 = eval(input(' Enter number of terms '))
FN = 0 ; SN = 1
print(FN)
print(SN)
for i in range(2, num1):
TN = FN + SN
print(TN)
FN = SN
SN = TN
i += 1

Loading