Skip to content

Instantly share code, notes, and snippets.

@Manume
Manume / Program to enter an integer and output its 15 multiples
Created May 21, 2014 09:36
Program to enter an integer and output its 15 multiples
#include <iostream.h>
#include <conio.h>
int main()
{
clrscr();
int x;
cout << "Enter an integer less than 2185 : ";
cin>>x;
cout << "The first 15 multiples of " << x << " are : ";
for(int y=1;y<16;y++)
@Manume
Manume / Program to enter two integers and print the quotient and remainder
Created May 21, 2014 09:32
Program to enter two integers and print the quotient and remainder
#include <iostream.h>
#include <conio.h>
int main()
{
clrscr();
int x,y,quotient,remainder;
cout << "Enter 2 integers greater than 0 : ";
cin>>x>>y;
quotient=x/y;
remainder=x-(quotient*y);
@Manume
Manume / program for find the number is odd or even
Created May 21, 2014 09:08
program for find the number is odd or even
#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
int x;
cout << "Enter an integer : ";
cin>>x;
if(x%2==0)
@Manume
Manume / biggest amoung three numbers
Last active August 29, 2015 14:01
biggest amoung three numbers
#include <iostream.h>
#include <conio.h>
int main()
{
clrscr();
int x,y,z,biggest;
cout << "Enter 3 integers : ";
cin>>x>>y>>z;
biggest=x>y?(x>z?x:z):(y>z?y:z);
cout << "The biggest integer out of the 3 integers you typed ";
@Manume
Manume / program for finding factorial
Created May 21, 2014 09:01
program for finding factorial
#include <iostream.h>
int fact (int i) {
int result = 1;
while (i > 0) {
result = result * i;
i = i-1;
}
return(result);
}
@Manume
Manume / roots of a quadratic equation
Created May 21, 2014 08:58
roots of a quadratic equation
#include <iostream.h>
#include <conio.h>
#include <math.h>
int main()
{
clrscr();
float a,b,c,d,root1,root2;
cout << "Enter the 3 coefficients a, b, c : " << endl;
cin>>a>>b>>c;
if(!a){
@Manume
Manume / programs for printing fibonacci series
Last active August 29, 2015 14:01
programs for printing fibonacci series
#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
int a,b,x,y,num1,ct;
a=0;
b=1;
cout << "Enter the number of terms (less than 25) : " << endl;
@Manume
Manume / sum of diagonal elements
Created May 21, 2014 08:39
programs for sum of diagonal elements
#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
int x;
int A[4][4],sum=0; //Reading the matrix.
cout << "Enter the elements of the matrix : " << endl;
for(int y=0;y<4;y++)
@Manume
Manume / sum and average of two numbers
Last active August 29, 2015 14:01
sum and average of two numbers
#include <iostream.h>
#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
int x,y,sum;
float average;
cout << "Enter 2 integers : " << endl;
@Manume
Manume / Program to enter a letter and output the next 2 letters
Last active August 29, 2015 14:01
Program to enter a letter and output the next 2 letters
#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
char charac;
cout << "Enter your letter : " << endl;
cin>>charac;
cout << "The 2 letters are : " << endl;
cout << (char)(charac-1) << endl;