- 1
Write a c program to demonistrate the use of string manipulation functions
My program is coming some fatal errors ones check my program if any mistake I'll rectify my program
6 ответов
+ 1
I can't see your program anywhere in the question description.
You have to share the link of that program here.
+ 1
Which decade are you living in ?
1) using conio header
2) using gets()
All these things have been removed from language standards long ago ( conio was not even part of it and was meant to work with old DOS based compilers )
Apart from that there are a few more errors here which I am seeing
1) stdlib is not included ( for exit() )
2) "str" is not declared anywhere
3) there is no function named upper(), lower(), reverse() or copy() in c library( assuming they are not user defined )
0
I will type the program and send it
0
/* string manipulation */
#include <stdio.h>
#include <conio.h>
#include <string.h>
main()
{
char str1[40], str2[40];
int c, l, ch;
printf("Enter your name \n");
gets (string);
while(1)
{
printf(" 0. exit \n
1. length \n
2. upper \n
3. lower \n
4. reverse \n
5. copy \n
6. comparision \n
7. append \n");
printf("Enter your choice \n");
scanf("%d",& ch);
switch(ch)
{
case 0: exit(0);
break;
case 1: l = strlen(strl);
printf("length is %d", l);
break;
case 2: str upper(str1);
printf("upper case is %s",str1);
break;
case 3: str lower(str1);
printf("lower case is %s",str1);
break;
case 4: str reverse(str1);
printf("reverse is %s",str1);
break;
case 5: str copy(str1);
printf("copy of the name is %s",str2);
break;
case 6:
0
Case 6: printf("Enter another name to compare: \n");
gets(str2);
l=strcmp(str1,str2);
if (l < 0)
printf ("your name is greater");
else
printf("newly entered name is greater");
break;
case 7: printf("enter your surname");
gets(str2);
strcat(str1,str2);
printf("after appending %s",str1);
break;
default: printf("wrong option");
break;
}
}
}
This is continuous program
0
I can't rectify my program pls send me program