Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Why cant I open a file by its explicit path?

1038


If the size of int data type is two bytes, what is the range of signed int data type?

1027


What is c language & why it is used?

1116


Write a program to check whether a number is prime or not using c?

1060


Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?

1254


What do you mean by keywords in c?

1153


where are auto variables stored? What are the characteristics of an auto variable?

1076


What is #include called?

1064


What extern c means?

1005


Write a Program to accept different goods with the number, price and date of purchase and display them

6239


How do you write a program which produces its own source code as output?

1121


What is return in c programming?

974


Explain how can I right-justify a string?

1046


Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?

1072


A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM

2134