This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#define MAX 10 | |
int arr[MAX],top1=-1,top2=MAX-1; | |
void push_stack1(int item) | |
{ | |
if(top1<top2) | |
{ | |
top1=top1+1; | |
arr[top1]=item; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#define MAX 100; | |
int top=-1,stack[100]; | |
void push(int item,int n) | |
{ | |
if(top==n-1) | |
printf("\n stack overflow"); | |
else | |
{ | |
top=top+1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
void sort(int a[],int n) | |
{ | |
int i,j,t; | |
for(i=1;i<=4;i++){ | |
t=a[i]; | |
for(j=i-1;j>=0&&a[j]>t;j--) | |
a[j+1]=a[j]; | |
a[j+1]=t;} | |
for(i=0;i<5;i++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main() | |
{ | |
int i,a[10],b[10],c[10],n; | |
printf("enter array size"); | |
scanf("%d",&n); | |
printf("\n enter array element"); | |
for(i=0;i<n;i++) | |
scanf("%d",&a[i]); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
class student | |
{ | |
int id; | |
char name[20]; | |
public: | |
void getstu(); | |
void putstu(); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
class student | |
{ | |
int id; | |
char name[20]; | |
public: | |
void getstu(); | |
void putstu(); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a=input('enter a:') | |
b=input('enter b:') | |
t=a; | |
a=b; | |
b=t; | |
print('a after swap:{} '.format(a) ) | |
print('b after swsp:{}'.format(b)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a=input('enter first number:') | |
b=input('enter second number:') | |
c=a+b | |
print('sum of a&b is {0} '.format(c) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a=1.1; | |
b=3.1; | |
c=a+b; | |
print('sum of a&b is {0} '.format(c) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
void add(int a,int b) | |
{ | |
printf("\n %d+%d=%d",a,b,a+b); | |
} | |
void sub(int a,int b) | |
{ | |
printf("\n %d-%d=%d",a,b,a-b); | |
} |
NewerOlder