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:madam
o/p:Palindrome
sample i/p:abcd
o/p:Not a Palindrome
#include <stdio.h>
#include <string.h>
int main() {
int i,j,l,flag=0;
sample i/p:
4
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
o/p:68
#include <stdio.h>
#include <stdio.h>
//series 1 2 3 5 8 13 21 34 55 89...
int main() {
int n,i,nx,t1=1,t2=2;
scanf("%d", &n);
if(n==1){
printf("1");
}else if(n==2){
printf("2");
}else{
@jeevisathya
jeevisathya / String reverse.c
Created October 21, 2020 14:35
string reverse
sample i/p: aaabbEEcc
o/p: cEba
#include <stdio.h>
#include <string.h>
int main() {
int f=0,s=0,l,i,co=0;
char str[1002],ans[1002];
scanf("%s", str);
l=strlen(str);
sample i/p:5
1 2 3 4 5
o/p:3
sample i/p:6
22 25 43 12 10 11 -->convert ascending order then...find meidan
o/p:17
#include <stdio.h>
int main() {
@jeevisathya
jeevisathya / Pyramid pattern.c
Created October 15, 2020 07:31
Pyramid pattern
sample i/p: 5
o/p: *
* * *
* * * * *
* * * * * * *
* * * * * * * * *
#include <stdio.h>
int main() {
int n,i,sp,k;
sample i/p: 4
o/p: 1
2*2
3*3*3
4*4*4*4
4*4*4*4
3*3*3
2*2
1
sample i/p: 5
o/p: 1
22
333
4444
55555
#include <stdio.h>
void printans(int n1){
int j;
sample i/p: 3 3
1 2 3
4 5 6
7 8 9
o/p: 1 4 7
2 5 8
3 6 9
#include <stdio.h>
#include <stdlib.h>
sample i/p: 5
o/p:
* *
** **
*** ***
**** ****
**********
**********
**** ****