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

iu6589u

1 Answers  


Write a regular expression for "Capgemini Services Pvt.Ltd"

0 Answers   Cap Gemini,


what is polymorphism?

1 Answers  


what is software engineer

0 Answers   Cognizant, NIIT,


what are nanoemulsions and how are they prepared? i want a brief outline about nanoemulsions.. is anyone of you is having any literature, can you share that? also any an idea where i can get the information?

0 Answers  






What is the difference between CD-R and CD+R?

0 Answers   NIIT,


what do you mean by data abstraction?

3 Answers  


MY interview Experience with TCS

1 Answers   TCS, Wipro,


what is your weaknesses

0 Answers   Genco, TCS,


wat r aptitude ques askd in TCS??

1 Answers   TCS,


How to Define the defect density?

0 Answers   CFCI,


how to create session in visual web jsf page as we create in jsp and how to maintain that jsf session in another jsp page? <JSF=java server faces> <JSP=java server pages>

1 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5085)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4452)
  • Electrical Engineering Interview Questions Electrical Engineering (16638)
  • 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)