Category: String
code: #include<stdio.h> #include<string.h> int main() { char first[90]=”abc”; char second[80]=”cat”; int i; i=strcmp(first,second); if(i==0) printf(“Both are equal\n”);…
code: #include<stdio.h> #include<string.h> int main() { int i; char str[80]; printf(“Enter a string:”); scanf(“%[^\n]”,str); //for(i=0; str[i]!=’\0′; i++);…
String Input Take Without any gets function just scanf is enough for taking any input withlout gets function #include<stdio.h>…
code: simple code: #include<stdio.h> int main() { char str[300],ch; int i,frequency=0; printf(“enter string:”); gets(str); printf(“enter character:”); scanf(“%c”,&ch);…
My Own Logic: #include<stdio.h> int main() { char str[200]; int i,j; gets(str); for(i=0;str[i]!=’\0′;i++); for(j=0;j<i;j++) { if(str[0]==str[i-1]){ printf(“Palindrome\n”);…
Problem from 101cproblems.com: Write a program which will take a sentence as input and tell us how…
Recent Comments