count the numbers between 100 and 300, that star
with 2 and ends with 2
Answer Posted / sujit
#include<stdio.h>
void main(void)
{
int i,d1,d2,count=0;
for(i=100;i<=300;i++)
{
while(i>0)
{
d1=i%10;
i=i/10;
d2=i%10;
i=i/10;
if(d1==2&&i==2)
count++;
}
}
printf("%d",count);
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Why cant I open a file by its explicit path?
If the size of int data type is two bytes, what is the range of signed int data type?
What is c language & why it is used?
Write a program to check whether a number is prime or not using c?
Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?
What do you mean by keywords in c?
where are auto variables stored? What are the characteristics of an auto variable?
What is #include called?
What extern c means?
Write a Program to accept different goods with the number, price and date of purchase and display them
How do you write a program which produces its own source code as output?
What is return in c programming?
Explain how can I right-justify a string?
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM