Thursday 3 July 2014

48) write a program to find the multiplication table of a number

#include<iostream>
#include<cmath>
using namespace std;
#define PI 3.14
int main()
{ int i,n,table;
    cout<<"enter the number n"<<endl;
cin>>n;
    cout<<"The table of" <<n<< "is"<<endl;
for(i=1;i<=10;i++)
{
       table=n*i;
       cout<<"n*i= "<<table<<endl;
}

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...