-
Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence
1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ...
shows the first 11 ugly numbers.
By convention, 1 is included.
Write a program to find and print the 1500'th ugly number.
-
Write a C program which when compiled and run, prints out a message
indicating whether the compiler that it is compiled with, allows /* */
comments to nest.
-
int main()
{
int i, n = 20;
for (i = 0; i < n; i--)
printf("*");
return 0;
}
Change/add only one character and print '*' exactly 20 times.
(there are atleast 3 solutions to this problem :-)
-
You are given have a datatype, say X in C.
The requirement is to get the size of the datatype, without declaring a
variable or a pointer variable of that type,
And, of course without using sizeof operator !
-
Given a singly-linked, find out the mid point of a single linked list in a
single parse of the list. Assume the program would be loaded in read-only
memory so no manipulation of the list is allowed.