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

Answers were Sorted based on User's Feedback



count the numbers between 100 and 300, that star with 2 and ends with 2..

Answer / amit sachan

int main()
{
int r,i,q,count=0;
for(i=100;i<300;i++)
{
r=i%10;
q=i/100;
if(r==2&&q==2)
count++;
}
printf("the total no=%d",count)
return(0);
}

Is This Answer Correct ?    40 Yes 1 No

count the numbers between 100 and 300, that star with 2 and ends with 2..

Answer / ajithchukku

10

Is This Answer Correct ?    21 Yes 6 No

count the numbers between 100 and 300, that star with 2 and ends with 2..

Answer / hana

in between 100 to 300 means 200 to 299...
if u see which starts with 2 and ends with 2 then 202,212,222,232,242,252,262,272,282,292....
hence answer is 10..

Is This Answer Correct ?    11 Yes 2 No

count the numbers between 100 and 300, that star with 2 and ends with 2..

Answer / 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

count the numbers between 100 and 300, that star with 2 and ends with 2..

Answer / sushma s

PL\SQL Code:

Declare
n number(10) := 0;
begin
for i in 100 .. 300
loop
if (substr(i,1,1) =2) and (substr(i,length(i),1) = 2) then
n := n +1;
dbms_output.put_line('number :'|| i ||' count:' ||n);
end if;
end loop;

end;

O/P: count: 10

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More C Interview Questions

Which weighs more, a gram of feathers or a gram of gold?

2 Answers  


What is a pointer?

1 Answers   ADP, IFFCO,


Whats s or c mean?

0 Answers  


How can I implement sets or arrays of bits?

0 Answers  


Why can't we initialise member variable of a strucutre

1 Answers  


what are bit fields in c?

2 Answers  


How can I sort a linked list?

0 Answers  


write a program to convert a expression in polish notation (postfix) to inline (normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix

0 Answers  


The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration

0 Answers  


How to add two numbers with using function?

4 Answers  


What are register variables in c?

0 Answers  


CAN WE DEFINE ANY FUNCTION WITHIN A FUNCTION.

15 Answers  


Categories