In this Programming Post, we will see an example program to get string of comma separated values from DataTable Column in C#.Net. Generally while working with DataTable, we may need to generate a comma (or any delimiter) separated string and even we may need to generate comma separated values with single… Continue Reading Get Comma (delimiter) Separated String from DataTable Column Values in C#.Net

> C# program to find the occurrence of a digit in a number > C# program to find frequency of digit in a given number In the previous posts, i have given C#.Net code to count the occurrences of a character in a string This program is to count the… Continue Reading C# Program to count particular digit in a given number

In this post, here is the C# code to convert DataTable to Dictionary. while working with DataSet or DataTable we may need key value pair to get Value by Id approach. So you may need to convert your DataTable to key value type i.e, Dictionary. you can also use Dictionary… Continue Reading DataTable to Dictionary Conversion in C#.Net

C PROGRAM TO FIND WHETHER STRING IS PALINDROME : #include<stdio.h> #include<string.h> main() { char str1[25],str2[25]; printf(“\n *** C Programs Blog ***”); printf(“\n >>> C Program to find whether string is Palindrome <<<“); printf(“\n\n Enter the string: “); scanf(“%s”,str1); strcpy(str2,str1); //copying str1 in str2 strrev(str2); //reversing str2 if(strcmp(str1,str2) == 0) //checking… Continue Reading C PROGRAM TO FIND WHETHER STRING IS A PALINDROME

C# PROGRAM TO GET FILE NAMES IN THE GIVEN DIRECTORY original post using System; using System.IO; namespace GetFileNames { class Program { static void Main(string[] args) { try { string FolderPath ; string[] Files; Console.WriteLine(” Enter the Directory Path to get File Names in it : “); FolderPath=Console.ReadLine(); Files =… Continue Reading C# PROGRAM TO GET FILE NAMES IN A GIVEN DIRECTORY

C# PROGRAM TO GET ALL FILE PATHS IN A GIVEN DIRECTORY original post using System; using System.IO; namespace GetFileNames { class Program { static void Main(string[] args) { try { string FolderPath ; string[] Files; Console.WriteLine(” Enter the Directory Path to get File Names in it : “); FolderPath=Console.ReadLine(); Files… Continue Reading C# PROGRAM TO GET FILE PATHS IN A GIVEN DIRECTORY

original post using System; namespace FactorialOfNumber { class Program { static void Main(string[] args) { int num, i, fact = 1; //clrscr(); Console.WriteLine(“\n >>C# PROGRAM TO FIND FACTORIAL OF GIVEN NUMBER <<\n”); Console.Write(“\n Enter the Number whose Factorial you want: “); num=Convert.ToInt32(Console.ReadLine()); for (i = num; i >= 2; i–)… Continue Reading C# Program to Find Factorial of Number

C# Program to find whether the Number is Palindrome or not original post using System; namespace NumberPalindrome { class Program { static void Main(string[] args) { int num, rem, sum = 0, temp; //clrscr(); Console.WriteLine(“\n >>>> To Find a Number is Palindrome or not <<<< “); Console.Write(“\n Enter a number:… Continue Reading C# Program to Reverse a Number & Check if it is a Palindrome

C# PROGRAM TO PRINT THE REVERSE OF A GIVEN NUMBER original post using System; namespace ReverseNumber { class Program { static void Main(string[] args) { int num, rem, sum = 0, rev; Console.WriteLine(“\n /** To Find Reverse Of a Number **/”); Console.Write(“\n Enter a number: “); num=Convert.ToInt32(Console.ReadLine()); while (Convert.ToBoolean(num)) {… Continue Reading C# Program to Print Reverse Of a Given Number

C# PROGRAM FOR IMPLEMENTING PRODUCT OF MATRICES USING ARRAYS : original post using System; namespace MatrixMultiplication { class Program { static void Main(string[] args) { //using 2D-ARRAYS int RowSize = 5, ColSize = 5; int[,] Matrix1 = new int[RowSize, ColSize]; int[,] Matrix2 = new int[RowSize, ColSize]; int[,] ResultMatrix = new… Continue Reading C# PROGRAM FOR PRODUCT OF MATRICES USING ARRAYS

Implementing Subtraction of Matrices Using 2D-Arrays: original post using System; namespace MatrixSubtractionProgram { class Program { static void Main(string[] args) { //using 2D-ARRAYS int RowSize = 5, ColSize = 5; int[,] Matrix1 = new int[RowSize, ColSize]; int[,] Matrix2 = new int[RowSize, ColSize]; int[,] ResultMatrix = new int[RowSize, ColSize]; int i,… Continue Reading C# PROGRAM TO PERFORM SUBTRACTION ON MATRICES USING ARRAYS

Implementing Addition of Two Matrices Using 2D-Arrays: original post using System; namespace MatrixAdditionProgram { class Program { static void Main(string[] args) { //using 2D-ARRAYS int RowSize = 5, ColSize = 5; int[,] Matrix1 = new int[RowSize, ColSize]; int[,] Matrix2 = new int[RowSize, ColSize]; int[,] ResultMatrix = new int[RowSize, ColSize]; int… Continue Reading C# PROGRAM FOR ADDITION OF MATRICES USING ARRAYS

C# program to print sum of series 1+2+3+….+n original post using System; namespace SumOfSeries { class Program { static void Main(string[] args) { int sum = 0, i, n; Console.WriteLine(“\n>>> C# Program to print Sum of Series 1+2+3+..+n <<<\n”); Console.Write(“\n Enter the number of terms:”); n=Convert.ToInt32(Console.ReadLine()); for (i = 1;… Continue Reading C# Program To Print Sum Of Series 1+2+3+..+n

using System; namespace ProductOfTwoNumbers { class Program { static void Main(string[] args) { int x, y; int result; Console.Write(“\n Enter the first number : “); x = Convert.ToInt32(Console.ReadLine()); /* reading 1st number from user*/ Console.Write(“n Enter the second number: “); y = Convert.ToInt32(Console.ReadLine()); /* reading 2nd number from user*/ result… Continue Reading C# PROGARM TO GET PRODUCT OF TWO NUMBERS

C# Program To Add Two Numbers/Integers without using Third Variable : using System;   namespace CsharpPrograms {     class Program     {         static void Main(string[] args)         {               int x,y;        … Continue Reading C# PROGRAM TO ADD TWO INTEGERS WITHOUT USING THIRD VARIABLE

C# PROGRAM TO ADD TWO INTEGERS USING METHOD : namespace CsharpPrograms {     class Program     {         static void Main(string[] args)         {               int x,y,result=0;             Console.WriteLine(“>>> PROGRAM TO… Continue Reading C# PROGRAM TO ADD TWO INTEGERS USING METHOD