Archive for December 2014
Code to make transpose of matrix in C++ (algo)
This program demonstrate the conversion of matrix to its transpose using array and loops. For more detail on int, array, for loop and other basic commands see our other post on respective topic.
#include<iostream>
#include<conio.h>
using.
Thursday, 25 December 2014
Posted by Unknown
Program, code to sort array in ascending or descending order in C++
This program demonstrate how to sort a array in ascending or descending order.. in C++.
This program uses function to do this and call the function of ascending or decending function whichever may user selects.
In Ascending algo
The program uses swap.
Wednesday, 24 December 2014
Posted by Unknown
Program in C++ to calculate words in sentence
This program demonstrate the calculation of words in sentence in a console application using C++
#include<iostream>
#include<conio.h>
using namespace std;
void main() {
char arr[1000] = { '-' };
int result = 0;
cout << "Enter.
Posted by Unknown
code to calculate average
This is a sample code to calculate average using array and for loop... for understanding array and for loop you may consult our explanation on that.
#include<iostream>
#include<conio.h>
using namespace std;
void main() {
int arr[10].
sample code to calculate area of a circle
Allah Ditta wants a program that calculates and displays the area of a wheel given its radius. Use the constant value 3.14159 for π.
//area of wheel
#include<stdio.h>;
#include<conio.h>;
//executing main program
void main()
{
//creating.
Posted by Unknown
Coding sample tip calculator
Allah Ditta wants a program that calculates and displays the amount he should tip a waiter at a restaurant. The program should subtract any cold drink charges from the total bill and then calculate the tip (using a percentage) on the remainder.
#include<stdio.h>;
#include<conio.h>;
//executing.
Arithmetic Operators, Largest & Smallest Value And Odd & Even Numbers
//Arithmetic operation on three numbers
#include<stdio.h>;
#include<conio.h>;
//executing main program
void main()
{
//creating var for storing values
int i;
int j;
int k;
//take input from user
printf("Input three different integers.
Posted by Unknown
Tag :
& Smallest,
Arithmetic,
C,
c++,
code,
coding,
even,
Largest,
Numbers,
odd,
Operators,
program,
project,
project c++(basic),
Value
how to sort a 2d array in C++
This program demonstrate how to sort 2d array in ascending order. The program explain it in 3x3 array you could change the values as required to meet your requirement
//prog for 2d array sort
#include<iostream>
#include<conio.h>
using.
coding for reversing a number and then printing it in c
#include<stdio.h>
#include<conio.h>
void main(){
int a;
int b;
printf("Enter the number You want to reverse: ");
scanf("%d", &a);
printf("\nNumber you Entered is: ");
b = printf("%d", a);
printf("\nIts reverse is: ");
for.
Coding program to print right triangle through odd number in C through asteriks.
#include<stdio.h>
#include<conio.h>
void main()
{
int a;
for(int d=1;d<=5;d++){
do {
printf("enter a odd no");
scanf("%d",&a);
}
while(a%2!=1);
int b;
for(b=0;b<a;b++)
{
for(int c=0;c<=b;c++)
printf("*");
.
Posted by Unknown
Program, code to multiply 2 matrix using 1-d array in c++
#include<iostream>
#include<conio.h>
using namespace std;
//Entr order of matrixes
void order(int &matrix1_rows, int &matrix1_colomn, int &matrix2_rows,int &matrix2_colomn) {
cout << "Enter no of rows of 1st Matrix:.
Posted by Unknown
Coing to Generate prime Number in c
#include<stdio.h>;
#include<conio.h>;
//code by waqas javed
//main
void main() {
//initializing vars
int i = 1; //prime number founded
int j = 2; //chk start point
int l = 1; //var factor chk var
int m = 0; //number of factor
int.
Posted by Unknown