Hi All, I have written the below program to find the substring in the string. in case one word coming multiple time how to handle this situation ? the below program retuning -1 as position which is wrong.
How to fixi it ?
- Input ("abhijit" , "jit")
- public int FindSubString(string strSuper, string strSub)
- char charSuper = strSuper.ToCharArray();
- char charSub = strSub.ToCharArray();
- //int position = -1;
- for (int i = 0; i <= charSuper.Length - charSub.Length; i++)
- int counter = 0;
- for (int J = 0; J < charSub.Length; J++)
- if (charSuper[i] != charSub[J])
- if (counter == charSub.Length)
- position = i - charSub.Length;
- return position;
Wap on 3d matrix by using random function print in a file. find the prime numbers from out put of above program. find the even numbers from o/p of 1st program. find the odd numbers from o/p of 1st program.
Need a program to search a word with all its synonymous ex : if I write screen find all that match of screen , lcd, monitor ,------ and so on
How to write c# program to count first 50 number divisible by 3 or 4.How to write c# program to count first 50 number divisible by 3 and 4.
I took a button in form.I have two classes emp and bonus.Bonus class is inherited from emp class.If bonus is giving ie in dialog box if we select ‘yes’ b ie bonus is added to sal and we get ts ie total sal along with eno.If bonus is not given ie in dialog box if we select ‘no’ we need to get...