Q : Write a C Program to print and count all numbers between 1 to 100 divisible by 11.
Answer :
#include<stdio.h>
#include<conio.h>
/*##########################
Girfa Student Help
Count & print all number 1 to 100
divisible by 11
##########################*/
void main()
{
int a,b;
clrscr();
for(a=1,b=0;a<=100;a++)
{
if(a%11==0)
{
printf("\t%d",a);
b++;
}
}
printf("\n\n\tTotal
%d numbers are divisible by 11",b);
getch();
}
No comments:
Post a Comment