Pages

Sunday, September 11, 2011

Basic Simple Programs for Interview

Hi Friends this time I am sharing you a very simple basic programs that generally asked at the time of interview. I used to asked it some times a very very simple programs ..we know that we can make it out those program but in interview time if you know how to do that then you can make it out very easyly and make a face that you are thinking about it ;) .. but you know already . and write it after some moments . ;) So just take a look before the interview ..!! All the best friends..!! Prog1:Retrun Vowel of Not. Solution: ======
public bool CheckVowel(object sender,KeyEventArgs e)
{
    if(e.KeyCode ==Keys.A||e.KeyCode ==Keys.E||e.KeyCode ==Keys.I||e.KeyCode ==Keys.O||e.KeyCode ==Keys.U)
    {    
    return true;
    }
    else
    return false;
}
Prog 2: Even Or Odd Solution: ======
public string EvenOrOdd( int Num)
{
    if(num%2 ==0)
    retrun "evenNumber";
    else
    return "OddNumber"
}
Prog3:PrimeNumber Soultion: ======
public string PrimeOrNot(int num)
{
    int i = 0;
    for (i = 3; i < num; i++)
    {
        if (num % i == 0)
        {
            Console.WriteLine("{0} is not a prime number", num);
            break;
        }
    }
    if (i == num)
    {
        Console.Writeline("{0} is a prime Number", num);
    }
}
Prog4:Fibonacci Series Solution: =======
public void FibonacciSeries(int number)
{
    int f_0 = 0;
    int f_1 = 1;
    int sum;
    Console.Write("{0} {1} ", f_0, f_1);
    for (int i = 2; i < number; i++)
    {
        sum = f_0 + f_1;
        f_0 = f_1;
        f_1 = sum;
        int value = f_0 + f_1;
        Console.Write("{0} ", value);
    }
}
Prog5: Factorial Solution: =======
public int Factorial(int number)
{
    int value = 1;
    for (int i = 1; i <= number; i++)
    {
        value = value * i;
    }
    return value;
}
Prog:6 Permutation (nPr) Solution: ====== Refrence Solution 5;
public double Permutation(int n, int r)
{
    double nPr = Factorial(n) / Factorial(n - r);
    return nPr;
}
 
Prog:7 Combination(nCr) Solution: ====== Refrence Solution 5;
public double Combination(int n , int r)
{
double nCr = Factorial(n)/Factorial(r)*(Factorial(n-r);
return nCr;
}
Prog8 : Add two numbers without using the plus operator Solution: ======
public int Add (int x , int y )
{
    return x-(-y);
}    
Prog9: Multiply two numbers without usering * operator Solution: =======
public int MulWithOutStarOperator( int x ,int y)
{
    for(int z= 1 ; z<=y ; z++)
    {
        int value = value +x;
    }
    return value;
} 
Prog:10 String Reverse Solution: =======
public string ReverseString(string str)
{
    int strLenght = str.Lenght;
    char strArray[] = new char[strLength];
    for ( int i = 0 ; i

Prog:11 Return multiple values from a function

Solution:
========

public int Add(int a,int b,out int c)
{
     c=a+1;
     return a+b;
}
Description : --------------- when we call the Add method we will get the sum of the a and b and can also use the value of c like int d=0; int e= Add(2,3,d) ; then the value of e will be 5 and the value of d will be 3.

58 comments:

  1. Replies
    1. Thanks.Nice article.
      If you want to know about latest technologies.visit below site.
      www.dotnetbasic.com

      Delete
  2. thanks for giving this much of information

    ReplyDelete
  3. Thank a lot.I think its look like c and c .Now i am doing BCA so i want to learn this for my future.

    ReplyDelete
  4. retrun "evenNumber";

    ReplyDelete
  5. This blog explains the details of most popular technological details. This helps to learn about what are all the different method is there. And the working methods all of that are explained here. Informative blog.
    Dotnet Training in Chennai

    ReplyDelete
  6. I already have collection of dotnet blogs which is useful for my career.it is also one ofmy fav blog because after refer your blog i can develop a frameworks quickly.


    Dotnet Training in Chennai

    ReplyDelete
  7. i got coding techniques and enough thing about dot net development. keep share more information about dot net programming and it methods.
    dot net training in chennai

    ReplyDelete
  8. Hello Sir,
    Thanks for the programs, I did used it in my interview and got the positive result. Well Explained, All the posts in your blog seems useful and also can learn Dot Net Training in Chennai

    ReplyDelete
  9. It was good very helpful to the new job seekers.....

    Best Dot net Training in Chennai

    ReplyDelete
  10. Really a good technical site,keep on writing good stuffs
    dot net training in chennai

    ReplyDelete
  11. Nice it seems to be good post... It will get readers engagement on the article since readers engagement plays an vital role in every blog.i am expecting more updated posts from your hands.

    PSD to Wordpress
    wordpress website development

    ReplyDelete
  12. very good information. keep it up.
    if you want to know the technologies updates,visit below site.
    dot net and latest technologies Tutorials

    ReplyDelete
  13. This comment has been removed by the author.

    ReplyDelete
  14. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.

    rpa training in chennai
    rpa training in bangalore
    rpa course in bangalore
    best rpa training in bangalore
    rpa online training

    ReplyDelete
  15. I likable the posts and offbeat format you've got here! I’d wish many thanks for sharing your expertise and also the time it took to post!!
    python course in pune
    python course in chennai
    python course in Bangalore

    ReplyDelete
  16. Awesome article. It is so detailed and well formatted that i enjoyed reading it as well as get some new information too.
    python interview questions and answers
    python tutorials
    python course institute in electronic city

    ReplyDelete
  17. Excellant post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
    Devops Training in Bangalore
    Best Devops Training in pune
    Microsoft azure training in Bangalore
    Power bi training in Chennai

    ReplyDelete
  18. Thank you for benefiting from time to focus on this kind of, I feel firmly about it and also really like comprehending far more with this particular subject matter. In case doable, when you get know-how, is it possible to thoughts modernizing your site together with far more details? It’s extremely useful to me.
    Data science course in bangalore | Data Science training with placement in Bangalore

    ReplyDelete
  19. Very nice post here and thanks for it .I always like and such a super contents of these post.
    Excellent and very cool idea and great content of different kinds of the valuable information's.

    Java training in Bangalore



    ReplyDelete
  20. Some us know all relating to the compelling medium you present powerful steps on this blog and therefore strongly encourage
    contribution from other ones on this subject while our own child is truly discovering a great deal.
    Have fun with the remaining portion of the year.

    Selenium training in bangalore | best selenium training in bangalore | advanced selenium training in bangalore | no.1 selenium training in bangalore

    ReplyDelete
  21. I found your blog while searching for the updates, I am happy to be here. Very useful content and also easily understandable providing.. Believe me I did wrote an post about tutorials for beginners with reference of your blog. 
    microsoft azure training in bangalore
    rpa training in bangalore
    rpa training in pune
    best rpa training in bangalore

    ReplyDelete
  22. Your blog provided us with valuable information to work with. Each & every tips of your post are awesome. Thanks a lot for sharing. Keep blogging..
    Webdesign

    ReplyDelete
  23. I am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.

    business analytics course

    data analytics courses

    data science interview questions

    data science course in mumbai

    ReplyDelete
  24. С сумкой для дамы всё не так просто. Для девушки на первое место выходит то, как глядится аксессуар. Дама принимает решение вбухать много времени, чтобы привязаться к исключительной для себя сумочке в гардеробчике, но при этом произвести первое впечатление на родственников. В сумке женщины можно заметить косметику, телефон, аксессуары, перчатки. Реестр иногда гораздо больше, всё упираеться от величины взятого атрибута. В гардеробе леди сразу много сумочек разных принадлежностей и видов. Для похода на прогулок или рутинных будней мисс избирает маленькую сумку или кросс-боди, для стрелки с подругами на закате. Интересно, что женщине иногда одаривают сумку. Аксессуары дама выбирает единолично, а когда есть потребность, то предъявляет друзьям то, что она предпочитает в качестве желанного сувенира. Подарки и спонтанные приобретения здесь будут неуместны. Покупка инной вещи – это ответственное событие, но безумно приятное. Не смотря не на что делайте это как можно чаще тут сумка без .

    ReplyDelete
  25. Attend The Data Scientist Courses From ExcelR. Practical Data Scientist Courses Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Scientist Courses. Data Scientist Courses

    ReplyDelete
  26. Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking Best data science courses in hyerabad

    ReplyDelete
  27. Ворожение разрешает увидеть, что вас ожидает в предстоящее время. Каждый хочет знать свое грядущее и воспринимает конкретные варианты гадания по максимуму достоверными. Гадание дзен Таро это шанс предсказать будущие явления непрерывно манил людей.

    ReplyDelete
  28. You have provided an nice article, Thank you very much for this one. And i hope this will be useful for many people.. and i am waiting for your next post keep on updating these kinds of knowledgeable things...
    Digital Marketing Training in Chennai

    Digital Marketing Course in Chennai


    ReplyDelete
  29. I think this is a standout amongst the most critical data for me. What"s more, i"m happy perusing your article. Be that as it may, ought to comment on some broad things ExcelR Business Analytics Courses

    ReplyDelete
  30. Very nice article!

    Thanks.
    Vikas(Dotnetbasic.com)

    ReplyDelete
  31. This post is so interactive and informative.keep update more information...
    German Classes in Velachery
    German Classes in chennai

    ReplyDelete
  32. Thanks for posting the best information and the blog is very good .data science course in udaipur

    ReplyDelete
  33. I really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work. Definitely a great post. Hats off to you! The information that you have provided is very helpful. data scientist course in kanpur

    ReplyDelete
  34. This post is so helpfull and informative.keep updating with more information...
    Devops Scope
    Devops Future Scope

    ReplyDelete