count the numbers between 100 and 300, that star
with 2 and ends with 2
Answer Posted / 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 |
Post New Answer View All Answers
Is Exception handling possible in c language?
Explain main function in c?
What are the restrictions of a modulus operator?
What is #pragma statements?
Is it better to use malloc() or calloc()?
How can I write a function that takes a format string and a variable number of arguments?
What are the 4 types of organizational structures?
What is difference between && and & in c?
Discuss the function of conditional operator, size of operator and comma operator with examples.
What are the keywords in c?
How can I manipulate individual bits?
What are the two types of structure?
What is double pointer in c?
Why is c faster?
What is the difference between declaring a variable by constant keyword and #define ing that variable?