Category Archives: Programs

Program to print ASCII characters

ASCII (American Standard Code for Information Interchange) is a character encoding standard (the Internet Assigned Numbers Authority (IANA) prefers the name US-ASCII. ASCII codes represent text in computers, telecommunications equipment, and other devices. Most modern character-encoding schemes are based on ASCII, although they support many additional characters. Exmple:   class Program { static void Main(string[]… Read More »

Program to Reverse the Number

In below program, I will reverse a number in c#.   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)) { rem = num % 10; //for getting remainder by… Read More »

WAP to show saddle point

#include<stdio.h> #include<conio.h> void main() { int a[3][3] = {1,2,3, 4,5,6, 7,8,9},i,j,k,value=0,temp=0,max=0; value = a[0][0]; printf(“\n Matrix Is “); for(i=0;i < 3;i++) { printf(“\n”); for(j=0;j < 3;j++) { printf(“\t%d”,a[i][j]); } } for(i=0; i < 3;i++) { value = a[i][0]; for(k=0;k < 3;k++) { if(value > a[i][k]) { value = a[i][k]; temp = k; } } max… Read More »

WAP to convert Sparse matrix to original matrix

//Sparse to Original Type -I #include <stdio.h> #include <conio.h> void main() { int a[5][5] = {0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0},i,j,k=1,sp[5][3] = {5,5,4, 0,2,5, 2,0,2, 3,4,9, 4,0,3}; for(k=1;k<5;k++) { a[sp[k][0]][sp[k][1]] = sp[k][2]; } printf(“\n Original Matrix “); for(i=0;i<5;i++) { printf(“\n”); for(j=0;j<5;j++) { printf(“\t%d”,a[i][j]); } } getch(); }