Commit 57872619 by videid

lab14

parent 0a342774
Showing with 59 additions and 0 deletions
#include <stdio.h>
#include <string.h>
int main(void){
char s[] = "azerty";
char ss[] = "azerty";
char b[64]={0};
char c[64]={0};
char ch[1]={0};
char *p;
char arr[64] = {0};
int a;
puts("enter string for concatenation");
gets(b);
while (getc(stdin)!='\n');
puts("enter a string for 5th question");
gets(c);
while (getc(stdin)!='\n');
puts("\n enter one character for search");
gets(ch);
a = strcmp(s,ss);
if (a == 0){
printf("starting strings are the same\n");
}
else {
printf("starting strings are different\n");
}
strcat(b,s);
printf("contatenated string is %s\n",b);
a = strlen(b);
printf("length of contatenated string is %d characters\n",a);
if (strstr(b,c)== NULL){
puts("no same string found");
}
else {
puts("same string found");
}
for(a=0;a<strlen(b);a++){
printf("\n%s",strstr(&b[a],&ch[0]));
if (strstr(&b[a],&ch[0])== NULL){
arr[a]=b[a];
}
else{
}
}
puts(arr);
printf("modified function is %d characters long",strlen(arr));
}
File added
File added
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment