count the numbers between 100 and 300, that star
with 2 and ends with 2
Answer Posted / 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 View All Answers
how can I convert a string to a number?
Explain modulus operator. What are the restrictions of a modulus operator?
What is c language used for?
What is hash table in c?
largest Of three Number using without if condition?
What is use of #include in c?
Explain what are the different file extensions involved when programming in c?
Write a simple code fragment that will check if a number is positive or negative.
Why doesnt this code work?
What is malloc calloc and realloc in c?
What are logical errors and how does it differ from syntax errors?
Can the sizeof operator be used to tell the size of an array passed to a function?
What is a example of a variable?
What is a pointer in c plus plus?
What is the difference between union and structure in c?