Thursday 3 July 2014

50)program to find the multiplication table of a number.it uses two functions in addition to function main().

#include<iostream>
#include<cmath>
using namespace std;
void read_X();
void table_x();
int X,N=1,table;
void read_X()
{  cout<<"enter the number "<<endl;
cin>>X;
}
void table_x()
{ cout<<"The table of" <<X<< "is"<<endl;
while(N<=10)
{  cout<<X<<"*"<<N<<"= "<<X*N<<endl;
    N++;
}
}
int main()
{ //int X,N=1,table;
 
    read_X();
    table_x();


}

No comments:

Post a Comment

Write a program which reads a set of integers into an integer array and then prints "YES"if all of them are same otherwise print "NO".

#include<stdio.h> int main() { int a[10],M=0,i,n; printf("enter a value for n\n"); scanf("%d",&n); fo...