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
State the difference between x3 and x[3].
Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.
Explain how do you list files in a directory?
What does double pointer mean in c?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
What are the benefits of c language?
What is the use of gets and puts?
What is structure and union in c?
What are the disadvantages of external storage class?
What is hash table in c?
1) write a program to generate 1st n fibonacci prime numbers using Nested if 2) write a program to generate twin prime numbers from m to n using nested if 3) write a program to check whether a given integer is a strong number or not using nested if 4) Write a program to generate prime factors of a given integer using nested if 5)write a program to generate prime numbers from m to n using nested if 6)write a program to generate perfect numbers from m to n using nested if 7)write a program to generate the pallindromes from m to n using neste if 8)write a program to generate armstrong numbers from m to n using nested if 9)write a program to generate strong numbers from m to n using nested if
How can I get the current date or time of day in a c program?
What is pre-emptive data structure and explain it with example?
Explain how do you determine whether to use a stream function or a low-level function?
Why is c so important?