SlideShare a Scribd company logo
1 of 13
Roll No. 20956


                                       1.Hello
using System;

namespace program
{
  class hello
  {
     static void Main(string[] args)
     {
        Console.WriteLine("hello");
        Console.ReadLine();
     }
  }
}
Roll No. 20956


                                              2.Prime
using System;

namespace series
{
  class prime
  {
     public static void Main(string[] args)
     {
       int x, i, count = 0;

            Console.WriteLine("Enter number");
            x = Convert.ToInt32(Console.ReadLine());
            for (i = 2; i <= x; i++)
            {
               if (x % i == 0)
                  count = count + 1;
            }
            if (count == 2)
               Console.Write("not prime number");
            else
               Console.Write("Prime number");
            Console.ReadLine();
        }
    }
}
Roll No. 20956


                                   3.Armstrong
using System;

namespace series
{
  class armstrong1
  {
     public static void Main(string[] args)
     {
       int x, cs = 0, rem, temp;
       Console.WriteLine("Enter number ->");
       x = Convert.ToInt32(Console.ReadLine());
       temp = x;
       while (x > 0)
       {
          rem = x % 10;
          cs = cs + (rem * rem * rem);
          x = x / 10;
       }
       if (temp == cs)
          Console.WriteLine("armstrong");
       else
          Console.WriteLine(" not armstrong");

            Console.Read();
        }

    }
}
Roll No. 20956


                                               4.a.
using System;

namespace series
{
  class tri
  {
     public static void Main(string[] args)
     {
       Console.WriteLine("Enter No");
       int n = Convert.ToInt32(Console.ReadLine());

            for (int y = 0; y <= n; y++)
            {

                for (int x = 1; x <= y; x++)
                {
                   Console.Write(x);

                }
                Console.WriteLine();
            }

            Console.ReadLine();

        }
    }
}
Roll No. 20956


                                            4.b
using System;

namespace PascalTriangle
{
  class PascalTriangle
  {
     static void Main(string[] args)
     {
        Console.WriteLine("Pascal Triangle Program");
        Console.Write("Enter the number of rows: ");
        int n = Convert.ToInt32(Console.ReadLine());
        for (int y = 1; y < n; y++)
        {
           int c = 1;
           for (int q = 1; q < n - y; q++)
           {
              Console.Write(" ");
           }
           for (int x = 1; x <= y; x++)
           {
              Console.Write(" {0:D} ", y);
           }
           Console.WriteLine();
           Console.WriteLine();
        }
        Console.ReadLine();
     }
  }
}
Roll No. 20956




                                             5.Series
using System;

namespace series
{
  class series
  {
     static void Main(string[] args)
     {

            for (int i = 0; i <= 100; i++)
            {
               if (i % 5 == 0)
                  continue;
               else
                  Console.WriteLine(i);
            }

            Console.Read();

        }
    }
}
Roll No. 20956


                                             6.Interest
using System;

namespace series
{
  class interest
  {
     public static void Main(string[] args)
     {

            Console.WriteLine("Enter the value of p");
            int p = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Enter the value of n");
            int n = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Enter the value of r");
            int r = Convert.ToInt32(Console.ReadLine());

            double s = (p * n * r) / 100;
            Console.WriteLine("Simple Interest ->t{0}", s);
            Console.ReadLine();
        }
    }
}
Roll No. 20956


                                         7.a.Odd Series
using System;

namespace series
{
  class _7ab
  {
     public static void Main(string[] args)
     {
       int e = 0, f = 0;
       Console.WriteLine("enter no.");
       int a = Convert.ToInt32(Console.ReadLine());
       for (int i = 1; i <= a; i++)
       {
          int c = i % 2;
          if (c == 0)
          {

                   continue;
                }
                else
                {
                   f = f + (i * i);
                }
            }

            Console.WriteLine(" total -> {0}", f);
            Console.ReadLine();
        }
    }
}
Roll No. 20956
Roll No. 20956


                                  7.b Even Series
using System;

namespace series
{
  class _7ab
  {
     public static void Main(string[] args)
     {
       int e = 0, f = 0;
       Console.WriteLine("enter no.");
       int a = Convert.ToInt32(Console.ReadLine());
       for (int i = 1; i <= a - 1; i++)
       {
          int c = i % 2;
          if (c == 0)
          {
             e = e + (i * i * i * i);
          }
          else
          {
             //f = f + (i * i);
             continue;
          }
       }
       Console.WriteLine("total -> {0}", e);

            Console.ReadLine();
        }
    }
}
Roll No. 20956
Roll No. 20956


                                          8.a.Pascal Triangle
using System;

namespace PascalTriangle
{

    class PascalTriangle
    {

        static void Main(string[] args)
        {

            System.Console.WriteLine("Pascal Triangle Program");
            System.Console.Write("Enter the number of rows: ");
            int n = Convert.ToInt32(Console.ReadLine());

            for (int y = 0; y < n; y++)
            {

              int c = 1;

              for (int q = 0; q < n - y; q++)
              {
                 Console.Write(" ");
              }

              for (int x = 0; x <= y; x++)
              {

                 Console.Write(" {0:D} ", c);
                 c = c * (y - x) / (x + 1);
              }
              Console.WriteLine();
              Console.WriteLine();
            }
            Console.Read();

        }

    }

}
Roll No. 20956

More Related Content

What's hot

Comprendre la programmation fonctionnelle, Blend Web Mix le 02/11/2016
Comprendre la programmation fonctionnelle, Blend Web Mix le 02/11/2016Comprendre la programmation fonctionnelle, Blend Web Mix le 02/11/2016
Comprendre la programmation fonctionnelle, Blend Web Mix le 02/11/2016Loïc Knuchel
 
Void numero
Void numeroVoid numero
Void numeroOiga Lin
 
[C++ Korea] Effective Modern C++ Study, Item 27, 29 - 30
[C++ Korea] Effective Modern C++ Study, Item 27, 29 - 30[C++ Korea] Effective Modern C++ Study, Item 27, 29 - 30
[C++ Korea] Effective Modern C++ Study, Item 27, 29 - 30Chris Ohk
 
matrix operation using operator overloading
matrix operation using operator overloadingmatrix operation using operator overloading
matrix operation using operator overloadingmaria azam
 
Writeup ctf online idsecconf 2017
Writeup ctf online idsecconf 2017Writeup ctf online idsecconf 2017
Writeup ctf online idsecconf 2017idsecconf
 
Bcsl 033 data and file structures lab s1-2
Bcsl 033 data and file structures lab s1-2Bcsl 033 data and file structures lab s1-2
Bcsl 033 data and file structures lab s1-2Dr. Loganathan R
 
exercise of basic computer programming.docx
exercise of basic computer programming.docxexercise of basic computer programming.docx
exercise of basic computer programming.docxmiftah88
 
Bodlogo
BodlogoBodlogo
Bodlogoorgil
 
Python codigo graficas
Python codigo graficasPython codigo graficas
Python codigo graficasBrayan Kalaka
 
Clang-tidy: путешествие внутрь AST C++
Clang-tidy: путешествие внутрь AST C++Clang-tidy: путешествие внутрь AST C++
Clang-tidy: путешествие внутрь AST C++corehard_by
 
Javascript i wydajność - czy to się spina?
Javascript i wydajność - czy to się spina?Javascript i wydajność - czy to się spina?
Javascript i wydajność - czy to się spina?Michał Kostrzyński
 
python-geohex
python-geohexpython-geohex
python-geohexRyo Aita
 
Java осень 2012 лекция 6
Java осень 2012 лекция 6Java осень 2012 лекция 6
Java осень 2012 лекция 6Technopark
 
Practica 4 errores
Practica 4 erroresPractica 4 errores
Practica 4 erroresUVM
 

What's hot (20)

Comprendre la programmation fonctionnelle, Blend Web Mix le 02/11/2016
Comprendre la programmation fonctionnelle, Blend Web Mix le 02/11/2016Comprendre la programmation fonctionnelle, Blend Web Mix le 02/11/2016
Comprendre la programmation fonctionnelle, Blend Web Mix le 02/11/2016
 
20150415 csharp6.0
20150415 csharp6.020150415 csharp6.0
20150415 csharp6.0
 
Void numero
Void numeroVoid numero
Void numero
 
[C++ Korea] Effective Modern C++ Study, Item 27, 29 - 30
[C++ Korea] Effective Modern C++ Study, Item 27, 29 - 30[C++ Korea] Effective Modern C++ Study, Item 27, 29 - 30
[C++ Korea] Effective Modern C++ Study, Item 27, 29 - 30
 
matrix operation using operator overloading
matrix operation using operator overloadingmatrix operation using operator overloading
matrix operation using operator overloading
 
Writeup ctf online idsecconf 2017
Writeup ctf online idsecconf 2017Writeup ctf online idsecconf 2017
Writeup ctf online idsecconf 2017
 
Bcsl 033 data and file structures lab s1-2
Bcsl 033 data and file structures lab s1-2Bcsl 033 data and file structures lab s1-2
Bcsl 033 data and file structures lab s1-2
 
exercise of basic computer programming.docx
exercise of basic computer programming.docxexercise of basic computer programming.docx
exercise of basic computer programming.docx
 
Bodlogo
BodlogoBodlogo
Bodlogo
 
Python codigo graficas
Python codigo graficasPython codigo graficas
Python codigo graficas
 
Clang-tidy: путешествие внутрь AST C++
Clang-tidy: путешествие внутрь AST C++Clang-tidy: путешествие внутрь AST C++
Clang-tidy: путешествие внутрь AST C++
 
JQuery
JQueryJQuery
JQuery
 
Javascript i wydajność - czy to się spina?
Javascript i wydajność - czy to się spina?Javascript i wydajność - czy to się spina?
Javascript i wydajność - czy to się spina?
 
Programs
ProgramsPrograms
Programs
 
Kelompok 2.6
Kelompok 2.6Kelompok 2.6
Kelompok 2.6
 
ikp213-06-template-c++
ikp213-06-template-c++ikp213-06-template-c++
ikp213-06-template-c++
 
python-geohex
python-geohexpython-geohex
python-geohex
 
Taller de string(java)
Taller de string(java)Taller de string(java)
Taller de string(java)
 
Java осень 2012 лекция 6
Java осень 2012 лекция 6Java осень 2012 лекция 6
Java осень 2012 лекция 6
 
Practica 4 errores
Practica 4 erroresPractica 4 errores
Practica 4 errores
 

Viewers also liked

Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionIn a Rocket
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting PersonalKirsty Hulse
 
10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer ExperienceYuan Wang
 
How to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanHow to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanPost Planner
 
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika AldabaLightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldabaux singapore
 

Viewers also liked (7)

Test Engine
Test EngineTest Engine
Test Engine
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting Personal
 
10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience
 
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job? Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
 
How to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanHow to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media Plan
 
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika AldabaLightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
 

All set1

  • 1. Roll No. 20956 1.Hello using System; namespace program { class hello { static void Main(string[] args) { Console.WriteLine("hello"); Console.ReadLine(); } } }
  • 2. Roll No. 20956 2.Prime using System; namespace series { class prime { public static void Main(string[] args) { int x, i, count = 0; Console.WriteLine("Enter number"); x = Convert.ToInt32(Console.ReadLine()); for (i = 2; i <= x; i++) { if (x % i == 0) count = count + 1; } if (count == 2) Console.Write("not prime number"); else Console.Write("Prime number"); Console.ReadLine(); } } }
  • 3. Roll No. 20956 3.Armstrong using System; namespace series { class armstrong1 { public static void Main(string[] args) { int x, cs = 0, rem, temp; Console.WriteLine("Enter number ->"); x = Convert.ToInt32(Console.ReadLine()); temp = x; while (x > 0) { rem = x % 10; cs = cs + (rem * rem * rem); x = x / 10; } if (temp == cs) Console.WriteLine("armstrong"); else Console.WriteLine(" not armstrong"); Console.Read(); } } }
  • 4. Roll No. 20956 4.a. using System; namespace series { class tri { public static void Main(string[] args) { Console.WriteLine("Enter No"); int n = Convert.ToInt32(Console.ReadLine()); for (int y = 0; y <= n; y++) { for (int x = 1; x <= y; x++) { Console.Write(x); } Console.WriteLine(); } Console.ReadLine(); } } }
  • 5. Roll No. 20956 4.b using System; namespace PascalTriangle { class PascalTriangle { static void Main(string[] args) { Console.WriteLine("Pascal Triangle Program"); Console.Write("Enter the number of rows: "); int n = Convert.ToInt32(Console.ReadLine()); for (int y = 1; y < n; y++) { int c = 1; for (int q = 1; q < n - y; q++) { Console.Write(" "); } for (int x = 1; x <= y; x++) { Console.Write(" {0:D} ", y); } Console.WriteLine(); Console.WriteLine(); } Console.ReadLine(); } } }
  • 6. Roll No. 20956 5.Series using System; namespace series { class series { static void Main(string[] args) { for (int i = 0; i <= 100; i++) { if (i % 5 == 0) continue; else Console.WriteLine(i); } Console.Read(); } } }
  • 7. Roll No. 20956 6.Interest using System; namespace series { class interest { public static void Main(string[] args) { Console.WriteLine("Enter the value of p"); int p = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Enter the value of n"); int n = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Enter the value of r"); int r = Convert.ToInt32(Console.ReadLine()); double s = (p * n * r) / 100; Console.WriteLine("Simple Interest ->t{0}", s); Console.ReadLine(); } } }
  • 8. Roll No. 20956 7.a.Odd Series using System; namespace series { class _7ab { public static void Main(string[] args) { int e = 0, f = 0; Console.WriteLine("enter no."); int a = Convert.ToInt32(Console.ReadLine()); for (int i = 1; i <= a; i++) { int c = i % 2; if (c == 0) { continue; } else { f = f + (i * i); } } Console.WriteLine(" total -> {0}", f); Console.ReadLine(); } } }
  • 10. Roll No. 20956 7.b Even Series using System; namespace series { class _7ab { public static void Main(string[] args) { int e = 0, f = 0; Console.WriteLine("enter no."); int a = Convert.ToInt32(Console.ReadLine()); for (int i = 1; i <= a - 1; i++) { int c = i % 2; if (c == 0) { e = e + (i * i * i * i); } else { //f = f + (i * i); continue; } } Console.WriteLine("total -> {0}", e); Console.ReadLine(); } } }
  • 12. Roll No. 20956 8.a.Pascal Triangle using System; namespace PascalTriangle { class PascalTriangle { static void Main(string[] args) { System.Console.WriteLine("Pascal Triangle Program"); System.Console.Write("Enter the number of rows: "); int n = Convert.ToInt32(Console.ReadLine()); for (int y = 0; y < n; y++) { int c = 1; for (int q = 0; q < n - y; q++) { Console.Write(" "); } for (int x = 0; x <= y; x++) { Console.Write(" {0:D} ", c); c = c * (y - x) / (x + 1); } Console.WriteLine(); Console.WriteLine(); } Console.Read(); } } }