in turboc++
----------------------------------------------------------------------------------------
//WAP to string with other character using(strset()) function.
#include <stdio.h>
#include<string.h>
#include<conio.h>
int main()
{
char st[100],st1;// declaration
printf("enter string\n");
gets(st);
printf("enter a character to set for\n");
st1=getchar();//inputs
printf("string before setting=%s\n",st);
strset(st,st1);
printf("string after setting with character=%c is =%s\n",st1,st);
getch();
return 0;
}
----------------------------------------------------------------------------------------
//WAP to string with other character using(strset()) function.
#include <stdio.h>
#include<string.h>
#include<conio.h>
int main()
{
char st[100],st1;// declaration
printf("enter string\n");
gets(st);
printf("enter a character to set for\n");
st1=getchar();//inputs
printf("string before setting=%s\n",st);
strset(st,st1);
printf("string after setting with character=%c is =%s\n",st1,st);
getch();
return 0;
}
-------------------------------------------------------------------------------------------
in codeblocks:
-----------------------------------------------------------------------------------------
//WAP to string with other character using(strset()) function.
#include <stdio.h>
#include<string.h>
int main()
{
char st[100],st1;// declaration
printf("enter string\n");
gets(st);
printf("enter a character to set for\n");
st1=getchar();//inputs
printf("string before setting=%s\n",st);
strset(st,st1);
printf("string after setting with character=%c is =%s\n",st1,st);
return 0;
}
No comments:
Post a Comment