forked from Abhijeet5665/c-programs-tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paths3.c
More file actions
37 lines (27 loc) · 559 Bytes
/
s3.c
File metadata and controls
37 lines (27 loc) · 559 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include<stdio.h>
#include<string.h>
#include<ctype.h>
//this program illustrates string comparison and also how to conver to uppercase letters and and
//it also demonstrates how to get a palindrome string comparision
void main(){
char str1[20],str2[20];
printf("eneyer the first string\n");
gets(str1);
int i=0;
while(str1[i]!='\0'){
str2[i]=str1[strlen(str1)-i-1];
i++;
}
str2[i]='\0';
char str4[20];
int j=0;
while(str2[j]!='\0')
{
str4[j]=toupper(str2[j]);
j++;
}
puts(str4);
if(strcmp(str1,str2)==0)
printf("both are equal\n");
puts(str2);
}