to write a program to search a character in a string and to
print till the character in the string using pointers in c
program



to write a program to search a character in a string and to print till the character in the string..

Answer / guest

char str[20]="some string";
char *ptr=str;
char search_char=e;
for(int t=0;i<strlen(str);i++)
{
if((*ptr)==e) (*ptr)=\0' //null charachter
}
printf("%s",str);

Is This Answer Correct ?    5 Yes 4 No

Post New Answer

More Engineering AllOther Interview Questions

Research reveals that high fiber content food is effective in preventing heart disease. However consumers are unable to take advantage of this finding as fiber content is usually not listed on the Nutrition Information label on food packages. Therefore as a further precaution in preventing heart disease, the government must regulate food industries to include the fiber content on the Nutrition Information label on food packages. Which of the following weakens the argument above?

1 Answers  


How to create test case scenario?

0 Answers   Hindustan Unilever Limited,


how 2 write a program of this pattern usin for loop?? 1 2 3 4 5 6 7 8 9 10

1 Answers  


Given a number (N), program to check whether its binary form has periodic or not

0 Answers  


Why Mother Board is called Mother Board & not Father Board?

12 Answers   Microsoft, Precision Infomatic, SoftStream,


in b+ trees, all the data is stored in leaf nodes. if all leaf nodes are crashed then how to get/recovery the data back?

0 Answers  


what will happpen when "MY COMPUTER" IS PERMANENTLY REMOVED FROM MY COMPUTER?

2 Answers  


successful command to make linux system as router in redhat-+

0 Answers  


multithreading??

0 Answers  


What is the difference between Huawei 5700 switch and 5300 switch?

1 Answers   Huawei,


Can anyone tell me the exact formulae with explanation for the questions related to cube which is asked for CTS? I have seen varieties of formulae in different sites.I need the exact on... So pls help me out!!!

0 Answers   CTS,


what are the artifacts in coding phase in SDLC????

0 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5085)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4453)
  • Electrical Engineering Interview Questions Electrical Engineering (16637)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1095)
  • Aeronautical Engineering Interview Questions Aeronautical Engineering (239)
  • Bio Engineering Interview Questions Bio Engineering (96)
  • Metallurgy Interview Questions Metallurgy (361)
  • Industrial Engineering Interview Questions Industrial Engineering (259)
  • Instrumentation Interview Questions Instrumentation (3014)
  • Automobile Engineering Interview Questions Automobile Engineering (332)
  • Mechatronics Engineering Interview Questions Mechatronics Engineering (97)
  • Marine Engineering Interview Questions Marine Engineering (124)
  • Power Plant Engineering Interview Questions Power Plant Engineering (172)
  • Textile Engineering Interview Questions Textile Engineering (575)
  • Production Engineering Interview Questions Production Engineering (25)
  • Satellite Systems Engineering Interview Questions Satellite Systems Engineering (106)
  • Engineering AllOther Interview Questions Engineering AllOther (1379)