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; | |
void tower(int n,char src,char aux,char targ) | |
{ | |
if(n==1){ | |
cout<<"transfer disk"<<n<<src<<"to"<<targ;} | |
else | |
{ | |
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> | |
//Compiler version gcc 6.3.0 | |
int main() | |
{ | |
int a[5],n,i,f=0; | |
printf("\nenter array element"); | |
for(i=0;i<5;i++) | |
scanf("%d",&a[i]); | |
printf("\nenter element u want to search from array"); |
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); | |
} |
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
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=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
#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
#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<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++) |
OlderNewer