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
| sample i/p: 1 2 5 4 3 6 | |
| asc: 1 2 3 4 5 6 | |
| o/p: 2 -> Two digits only varies after sorting | |
| sample i/p: 1 4 5 2 3 6 | |
| asc: 1 2 3 4 5 6 | |
| o/p: 4 | |
| #include<stdio.h> | |
| int main() { |
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
| sample i/p: a+b | |
| o/p: +ab | |
| sample i/p: a+b*c | |
| o/p: +a*bc | |
| #include<stdio.h> | |
| #include <string.h> | |
| #include <ctype.h> | |
| char stack[102]; |
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
| sample i/p: x*y+z | |
| o/p: xy*z+ | |
| sample i/p: x+y | |
| o/p: xy+ | |
| #include<stdio.h> | |
| #include<string.h> | |
| #include<ctype.h> | |
| //infix to postfix expression |
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
| sample i/p: 2 2 | |
| 1 2 | |
| 3 4 | |
| o/p: 1 3 | |
| 2 4 | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int mat(int *m, int r, int c){ | |
| int i,j; |
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
| sample i/p: +44 | |
| o/p: 8 | |
| sample i/p: ++45 | |
| o/p: 9 | |
| #include<stdio.h> | |
| #include<string.h> | |
| int stack[20]; | |
| int top=-1; | |
| void push(int num){ //Prefix expression |
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
| sample i/p: 245+* | |
| o/p: 18 | |
| sample i/p: 21+ | |
| o/p: 3 | |
| #include<stdio.h> | |
| #include<stdlib.h> | |
| #include<string.h> | |
| int stack[20]; |
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
| sample i/p: Hi hello welcome to india | |
| o/p: welcome | |
| #include<stdio.h> | |
| #include<string.h> | |
| int main() { | |
| int i=0,j,y,x,max=0; | |
| char s[102][102]; | |
| while(scanf("%s ", s[i])>0){ | |
| 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> | |
| #include<stdlib.h> | |
| struct node{ | |
| int data; | |
| struct node* link; | |
| }; | |
| struct node* root = NULL; | |
| int len; | |
| void append(void); | |
| int length(void); |
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
| sample i/p: 6 | |
| o/p: | |
| 66666666666 | |
| 65555555556 | |
| 65444444456 | |
| 65433333456 | |
| 65432223456 | |
| 65432123456 | |
| 65432223456 | |
| 65433333456 |
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
| sample i/p: 5 | |
| o/p: | |
| 1 1 | |
| 12 21 | |
| 123 321 | |
| 1234 4321 | |
| 1234554321 | |
| #include<stdio.h> | |
| int main() { |
NewerOlder