Techno Compile is a free source of learning Technologies online.The Content includes SQL Server,C#,HTML,Ado.net and Computer TIPS and Tricks and much more.
23 March 2019
06 March 2019
C# Programme to check Armstrong Number
In the case of Armstrong number, the sum of the cube of each digit of the number should be equal to the original number.
for example- 153
1*1*1+5*5*5+3*3*3 = 153.
using System;
namespace Armstrong_Number
{
class Program
{
static void Main(string[] args)
{
int Number, Remainder, sum = 0, temp;
Console.Write("Enter the Number = ");
Number = int.Parse(Console.ReadLine());
temp = Number;
while (Number > 0)
{
Remainder = Number % 10;
sum = sum + (Remainder*Remainder*Remainder);
Number = Number / 10;
}
if (temp == sum)
{
Console.Write(+temp+" is a Armstrong Number.");
}
else
{
Console.Write(+temp+" is Not a Armstrong Number.");
}
Console.WriteLine();
}
}
}
Output:-
for example- 153
1*1*1+5*5*5+3*3*3 = 153.
using System;
namespace Armstrong_Number
{
class Program
{
static void Main(string[] args)
{
int Number, Remainder, sum = 0, temp;
Console.Write("Enter the Number = ");
Number = int.Parse(Console.ReadLine());
temp = Number;
while (Number > 0)
{
Remainder = Number % 10;
sum = sum + (Remainder*Remainder*Remainder);
Number = Number / 10;
}
if (temp == sum)
{
Console.Write(+temp+" is a Armstrong Number.");
}
else
{
Console.Write(+temp+" is Not a Armstrong Number.");
}
Console.WriteLine();
}
}
}
Output:-
![]() |
| Armstrong number |
05 March 2019
C # programme to print the fibonacci series
In case of fibonacci series, The next printed number is the sum of previous two numbers like 0,1,1,2,3,5,8,13,21 etc. The first two numbers of fibonacci series are 0 and 1.
using System;
namespace Fibonacci_series
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter Your target number");
int Target_Number = Convert.ToInt32(Console.ReadLine());
int First_Number = 0;
int Second_Number = 1;
int sum;
Console.Write(+First_Number+" "+Second_Number);//print 0 and 1
for (int i = 2; i < Target_Number; i++)//loop starts from 2 because 0 and 1 already printed
{
sum = First_Number + Second_Number;
First_Number = Second_Number;
Second_Number = sum;
Console.Write(" " + sum);
}
Console.WriteLine();
}
}
}
OutPut:-
using System;
namespace Fibonacci_series
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter Your target number");
int Target_Number = Convert.ToInt32(Console.ReadLine());
int First_Number = 0;
int Second_Number = 1;
int sum;
Console.Write(+First_Number+" "+Second_Number);//print 0 and 1
for (int i = 2; i < Target_Number; i++)//loop starts from 2 because 0 and 1 already printed
{
sum = First_Number + Second_Number;
First_Number = Second_Number;
Second_Number = sum;
Console.Write(" " + sum);
}
Console.WriteLine();
}
}
}
OutPut:-
![]() |
| Fibonacci Series |
25 February 2019
What is Database || What is SSMS || Connecting to SQL Server Management Studio
What is Database ?
A database is a collection of information or an organized collection of data which is generally stored and accessed electronically from a computer system or we can say, A database is a collection of tables and database objects like store procedures,view,functions etc.
What is SQL Server Management Studio (SSMS) ?
SQL Server management studio is an software application which allows you to create and manage your database. Many people stay confused with it.
but let me tell you SQL Server Management Studio is a client tool and not a database by itself and it use to interact with the database server.
As you can see above,there is a centralized database server and with that there are 4 Clients connect using SSMS.
Different Authentication Method that use to connect to SSMS ?
A database is a collection of information or an organized collection of data which is generally stored and accessed electronically from a computer system or we can say, A database is a collection of tables and database objects like store procedures,view,functions etc.
What is SQL Server Management Studio (SSMS) ?
SQL Server management studio is an software application which allows you to create and manage your database. Many people stay confused with it.
but let me tell you SQL Server Management Studio is a client tool and not a database by itself and it use to interact with the database server.
As you can see above,there is a centralized database server and with that there are 4 Clients connect using SSMS.
Different Authentication Method that use to connect to SSMS ?
Programme to reverse a number
C# Programme to reverse a number....
using System;
namespace ReverseNumber{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter a No. to reverse");
int Number = int.Parse(Console.ReadLine());
int Reverse = 0;
while (Number > 0)
{
int remainder = Number % 10;
Reverse = (Reverse * 10) + remainder;
Number = Number / 10;
}
Console.WriteLine("Reverse No. is {0}", Reverse);
Console.ReadLine();
}
}
}
Subscribe to:
Comments (Atom)

