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

Explain what is the stack?

1041


What is the difference between array and structure in c?

1080


What is the difference between fread buffer() and fwrite buffer()?

1105


how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software

3258


How can type-insensitive macros be created?

1126


ATM machine and railway reservation class/object diagram

5191


Why do we use int main instead of void main in c?

1099


if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0

1881


What are the salient features of c languages?

1043


Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.

1592


Is using exit() the same as using return?

1247


Explain how do you determine the length of a string value that was stored in a variable?

1092


Explain 'far' and 'near' pointers in c.

1080


a program that can input number of records and can view it again the record

1863


Explain logical errors? Compare with syntax errors.

1009