DO NOT MISS

Ads

Sunday 31 July 2016

Program 11 Using While loop


#include<stdio.h>
#include<conio.h>

void main()

       {

           int n,i,;
           clrscr();

           printf("enter a number:");
           scanf("%d",&n);

           i=1;
           printf(“Factors of the given no is:\n”);
               
while(i<=n)

                  {
                       if(n%i==0)
                       printf(“%d\n”,n);
                       i++;

                 }

           getch();

      }

Output:-
______________________________________________________
______________________________________________________
______________________________________________________
_____________________________________________________


Greataims

 
Copyright © 2016 Computersadda. Designed by @ Computersadda Team - Published By Greataims