Professional Documents
Culture Documents
CSE – A
04020802718
#include <stdio.h>
#include <string.h>
if(flag==0)
return 0;
else
return 1;
}
int main()
{
char str[50];
printf (" Enter the string: ");
gets("%s", &str);
char str2[50];
printf (" Enter the string: ");
gets("%s", &str2);
char str3[100];
int x;
case 2:
int i = 0, j = 0;
printf("\nString Concatenation : ");
while (str[i] != '\0') {
str3[j] = str[i];
i++;
j++;
}
i = 0;
while (str2[i] != '\0') {
str3[j] = str2[i];
i++;
j++;
}
str3[j] = '\0';
printf("\nConcatenated string: %s", str3);
break;
case 3:
printf("\nString Compare : ");
int compare=stringcompare(str1,str2);
if(compare==0)
printf("strings are equal");
else
printf("strings are not equal");
break;
case 4:
int i, len, temp;
len = strlen(str1);
struct Node
{
int data;
struct Node* next;
};
if (*head_ref == NULL)
return;
first = *head_ref;
rest = first->next;
if (rest == NULL)
return;
recursiveReverse(&rest);
first->next->next = first;
first->next = NULL;
*head_ref = rest;
}
new_node->data = new_data;
new_node->next = (*head_ref);
(*head_ref) = new_node;
}
void main()
{
struct Node* head = NULL;
push(&head, 20);
push(&head, 4);
push(&head, 15);
push(&head, 85);