Practical No 15
Practical No 15
#include<stdio.h>
#include<conio.h>
void main()
{
char str[100];
int i, len = 0, flag = 1;
if (flag)
printf("The string is a palindrome.\n");
else
printf("The string is not a palindrome.\n");
getch();
}
----------------------OUTPUT-----------------
#include <stdio.h>
#include <string.h>
#include<conio.h>
void main()
{
char str1[100], str2[100], temp[100];
strcpy(temp, str1);
strcpy(str1, str2);
strcpy(str2, temp);
printf("After swapping:\n");
printf("First string: %s\n", str1);
printf("Second string: %s\n", str2);
getch();
}
Example Output