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();
}
}
}