Pages

Sunday, 20 May 2012

program to multiplication


96./*Write a program to multiplication*/

#include<stdio.h>
#include<conio.h>.
main()
{
            int array[5],i;
            clrscr();
            printf("Enter an array:\n");
            for(i=0;i<5;i++)
            {
            scanf("%d",&array[i]);
            }
            for(i=0;i<5;i++)
            {
            array[i]=array[i]*7;
            }
            printf("\nThe array elements after multiplication are:\n");
            for(i=0;i<5;i++)
            {
            printf("%d\n",array[i]);
            }
            getch();
}


OUTPUT


            Enter an Array :

            2
            3
            4
            5
            6

            The array elements after multiplication are:

            14
            21
            28
            35
            42

No comments:

Post a Comment