Skip to content

Instantly share code, notes, and snippets.

View jeevisathya's full-sized avatar
🏠
Working from home

Jeevitha S jeevisathya

🏠
Working from home
  • Excelacom technologies
  • chennai
View GitHub Profile
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() {
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() {
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){
@jeevisathya
jeevisathya / Decimal to Octal.c
Last active November 16, 2020 08:51
dec to oct
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){
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){
@jeevisathya
jeevisathya / Decimal to Binary.c
Created November 16, 2020 08:42
decimal to binary
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;
@jeevisathya
jeevisathya / string permutation.c
Created November 12, 2020 08:33
string permutation
sample i/p:
abc
o/p:
abc
acb
bac
bca
cba
cab
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){
@jeevisathya
jeevisathya / Exapnd alphabet.c
Created November 11, 2020 15:12
Expand alphabet
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);
@jeevisathya
jeevisathya / numbers rotation.c
Created November 10, 2020 15:25
number rotation
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;