1. How will you complete the foreach loop in the C#.NET code snippet given below such that it correctly prints all elements of the array a? int[][]a = new int[2][]; a[0] = new int[4]{6, 1 ,4, 3}; a[1] = new int[3]{9, 2, 7}; foreach (int[ ] i in a) { / Add loop here / Console.Write(j + " "); Console.WriteLine(); }






Write Comment

Type in
(Press Ctrl+g to toggle between English and the chosen language)

Comments

Tags
Show Similar Question And Answers
QA->"All are one Self-fratenity such being the dictum to avow, In such a light how can we take life and devoid of least pity go on to eat" - Who said?....
QA->As per Co-operative societies rule ‘Net profit’ means net profit as certified by :....
QA->"Take care to get what you like, or you will be forced to like what you get"....
QA->You are very arrogant. It is high time you.........that you are not the most important person in the world.....
QA->Who said ‘Happiness is when what you think; what you say; and what you do are in harmony’?....
MCQ->How will you complete the foreach loop in the C#.NET code snippet given below such that it correctly prints all elements of the array a? int[][]a = new int[2][]; a[0] = new int[4]{6, 1 ,4, 3}; a[1] = new int[3]{9, 2, 7}; foreach (int[ ] i in a) { / Add loop here / Console.Write(j + " "); Console.WriteLine(); }....
MCQ-> Read the following passage carefully and answer the questions given.Do you ever feel there’s is a greater being inside of you bursting to get out? It is the voice that encourages you to really make something of your life. When you act congruently with that voice, it’s like your are a whole new person. You are bold and courageous. You are strong. You are unstoppable. But, then reality sets in, and soon those moments are history. It is not hard to put youself temporarily into an emotionally motivated state. Just listen to that motivational song for that matter. However, this motivation does not stay forever. Your great ideas seem impractical. How many times have you been temporarily inspired with a idea like, “I want to start my own business.” And then a week later it’s forgotten? You come up with inspiring ideas when you are motivated. But you fail to maintain that motivation through the action phase.The problem we ask ourselves is, why does this happen? You can listen to hundereds of motivational speakers and experience an emotional yo-yo effect, but it does not fast. The problem is that as we are intellectually guided, we try to find logic in emotional motivation and as we fail to find logic eventually phases out. I used to get frustrated when my emotional motivation fizzled out after a while. Eventually, I realised that being guided by intellect, was not such a bad thing after all. I just had to learn to use my mind as an effective motivational tool. I figured that if I was not feeling motivated to go after a particular goal, may be there was a logical reason for it. I noted that when I had strong intellectual reasons for doing something. I usually did not have trouble taking action.But when my mind thinks a goal is wrong on some level. I usually feel blocked. I eventually realised that this was my mind’s way of telling me the goal was a mistake to begin with. Sometimes a goal seem to make sense on one level but when you look further upstream, it becomes clear that the goal is ill advised. Suppose you work in sales, and you get a goal to increase your income by 20% by becoming a more effective salesperson. That seems like a reasonable and intelligent goal. But may be you are surprised to find yourself encountering all sorts of internal blocks when you try to pursue it. You should feel motivated, but you just don’t. The problem may be that on a deeper level your mind knows you don’t want to be working in sales at all. You really want to be a musician. Matter how hard you push yourself in sales career, it will always be a motivational dead end.Further when you set goals, that are too small and too timid, you suffer a perpetual lack of motivation. You just need to summon the courage to acknowledge your true desires. Then you will have to deal with the self-doubt and fear that’s been making you think too small. Ironically, the real key to motivation is to set the goals that scare you. You are letting fears, excuses and limiting beliefs hold you back. Your subconscious mind knows you are strong, so it won’t provide any motivational fuel until. You step up, face your fears, and acknowledge your hearts desire. Once you finally decide to face your tears and drop the excuses, then you will find your motivation turning on full blast.What does the author want to convey when he says, “When you look further upstream, it becomes clear that the goal is ill advised.”?
 ....
MCQ->Which of the following statements are correct about the C#.NET code snippet given below? int[] a = {11, 3, 5, 9, 4}; The array elements are created on the stack. Refernce a is created on the stack. The array elements are created on the heap. On declaring the array a new array class is created which is derived from System.Array Class. Whether the array elements are stored in the stack or heap depends upon the size of the array.....
MCQ-> Read the following passage carefully and answer the question given below it. Certain words are printed in bold to help you to locate them while answering some of the question.Once upon a time in a village, there lived six blind men. In spite of their blindness they had managed to educate themselves Seeking to expand their knowledge they decided to visit a zoo and try out their skills in recognizing animals by their touch. The first animal they came across, as soon as they entered the zoo was an elephant.As the first man approched the elephant, the elephant waved its trunk, and the man felt something brush past him. Managing to hold on to it, and found something long and moving. He jumped back in alarm, shouting "Move away ! This is a snake !" Meanwhile ,the second man had moved closer, and walked right near its legs. As the man touched the thick, cylindrical¬shaped legs, he called out "Do not worry. These are just four trees here. There is acertainly no snake !" The third man was curious hearing the other two, and moved forward. As he walked towards the elephant, he felt his hand touch one of the tusks. Feeling the smooth, sharp ivory tusk, the man cried out " Be careful ! There is a sharp spear here". The fourth man cautiously walked up behind the elephant and felt its swinging tail. "It's just a rope ! he said. The fifth man had meanwhile reached out and was touching the huge ears of the animal. "I think all of you have lost your sense of touch !" he said. "This is nothing but a huge fan!" The sixth man did not want to be left out. As he walked towards the elephant, he bumped into the massive body, and he exclaimed, "Hey ! This is just a huge mud wall ! There is no animal at all !" All six of them were convinced that they were right, and began arguing amongst themselves.The zoo keeper returned to the elephant and saw each of them shouting at the top of their voice ! "Quiet" he shouted out and when they had calmed down, he asked, "Why are all of you shouting and arguing in this manner ?" They replied, "sir, as you can see, we all are blind. We came here to expand our knowledge. We sensed an animal here and tried to get an idea of its appearance by feeling it. However, we are not able to arrive at a consensus over its appearance, and hence are arguing. Can you please help us and tell us which of us is right" ?The zoo keeper laughed before answering "My dear men, each of you has touched just one portion of the animal. The animal you see is neither a snake, nor any of other things you have mentioned. The animal in front on you is an elephant !" As the men, bowed their head ashamed of the scence they had created, the zoo keeper said, "My dear men, this is a huge animal and luckily, it is tame. It stood by calmly as each of you touched it. You are extremely lucky that it stayed calm even during your argument, for if it had got angry, it would have trampled all of you to death !" He continued further , "It is also important to learn to share and pool your knowledge .Instead of fighting amongst yourselves, if you had tried to put all your observations together, you might have had an idea of the animal as a whole ! Also, when you cannot see the entire truth, it is better to go to someone who does know the complete truth, rather than guess about small parts of it. Such half¬knowledge is not only useless, but also dangerous. If you had come directly to me, I would have helped you identify all the animals without putting you in danger !" The six men apologized to the zoo keeper, and assured him that they had learnt their lesson. From now on they would seek true knowledge from qualified people, and would seek true knowledge from qualified people, and would also try to work together as a team so that they could learn moreWhich part of the elephant resembled a big fan ?
 ....
MCQ->Which of the following statements is correct about the C#.NET program given below if a value "6" is input to it? using System; namespace IndiabixConsoleApplication { class MyProgram { static void Main(string[] args) { int index; int val = 44; int[] a = new int[5]; try { Console.Write("Enter a number:"); index = Convert.Tolnt32(Console.ReadLine()); a[index] = val; } catch(FormatException e) { Console.Write("Bad Format"); } catch(IndexOutOfRangeException e) { Console.Write("Index out of bounds"); } Console.Write("Remaining program"); } } }....
Terms And Service:We do not guarantee the accuracy of available data ..We Provide Information On Public Data.. Please consult an expert before using this data for commercial or personal use
DMCA.com Protection Status Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions