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: | |
| 5 6 15 16 25 | |
| 4 7 14 17 24 | |
| 3 8 13 18 23 | |
| 2 9 12 19 22 | |
| 1 10 11 20 21 | |
| #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: 5 | |
| 2 3 0 1 4 | |
| o/p: 4 0 3 1 2 | |
| sample i/p: 6 | |
| 3 1 2 5 8 9 | |
| o/p: 9 1 8 2 5 3 | |
| #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:15 | |
| o/p:13 | |
| #include <stdio.h> | |
| #include <math.h> | |
| int main() { | |
| int n,i=0,octdec=0,r,t; | |
| scanf("%d", &n); | |
| t=n; | |
| while(t!=0){ |
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:13 | |
| o/p:15 | |
| #include<stdio.h> | |
| #include<math.h> | |
| int main() { | |
| int n,t,oct=0,r,i=1; | |
| scanf("%d", &n); | |
| t=n; | |
| while(t!=0){ |
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:1101 | |
| o/p:13 | |
| #include <stdio.h> | |
| #include <math.h> | |
| int main() { | |
| int n,i=0,dec=0,r,t; | |
| scanf("%d", &n); | |
| t=n; | |
| while(t!=0){ |
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:13 | |
| o/p:1101 | |
| #include<stdio.h> | |
| int main() { | |
| int n,t,r,j,ans[1002],co=0; | |
| scanf("%d", &n); | |
| t=n; | |
| while(t!=0){ | |
| r=t%2; //Dec to bin | |
| ans[co++]=r; |
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: | |
| abc | |
| o/p: | |
| abc | |
| acb | |
| bac | |
| bca | |
| cba | |
| cab |
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: a10b12 | |
| o/p: aaaaaaaaaabbbbbbbbbbbb | |
| #include<stdio.h> | |
| #include<string.h> | |
| int main() { | |
| int i=0,j,s=0; | |
| char str[102],t; | |
| scanf("%s", str); | |
| while(str[i]!=0){ |
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: a2b4c3 | |
| o/p: aabbbbccc | |
| #include<stdio.h> | |
| #include <string.h> | |
| int main() { | |
| int i,j,l,x; | |
| char str[1002]; | |
| scanf("%s", str); | |
| l=strlen(str); |
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: 8276 | |
| o/p: 6827 7682 2768 8276 | |
| #include<stdio.h> | |
| int main() { | |
| int n,ans=1,t,re,co=0,i; | |
| scanf("%d", &n); | |
| t=n; | |
| while(n!=0){ | |
| ans=ans*10; |