Programs Questions and Answers

11. Write a function maxsubstring (str,alpha,theta) str is the source string and have to return maximum sub string which starts with alpha and ends with theta.
Input : , Output :
     
12. You have a job in which you have to take time stamps and store them. So Write a data structure that can minimize the storage requirements of Year, Month, Date, Hour, Minute.
Input : , Output :
     
13. Write a program to find the four digit numbers, which are perfect squares, and all the digits in that number are even.
Input : , Output :
     
14. Start from a random number, generate a sequence such that if number is odd multiply it 3 and add 1. If number is even, divide the number by 2. This Sequence will always cyclic with 4, 2, 1. In this sequence, find the maximum power of 2 generated in the sequence and print only the power, not the sequence.
Input : , Output :
     
15. Start with a random 2 digit number, The series is generated by multiplying the number by 2 and placing the last 2 digits as the next number. Series continues until one of the element repeats.
Input : , Output :
     
16. Write a program to print all the four digit numbers whose squares must have all the even digits.
Input : , Output :
     
17. Write a program to print the pyramid up to the passed integer value. 1 2 3 4 5 6 7 8 9 10 11 12 13 . . If we pass the value 13 it should print like the above (no need to print the 3 dots)
Input : , Output :
     
18. Write a function which takes one string S, one character X, one more Character Y, which should return the longest substring in the String S, which starts with the X and ends with Y?
Input : , Output :
     
19. Write a program to accept two time stamps in the given format HH:MM:SS using apropriate datatypes and find the difference between the time stamps in seconds.
Input : , Output :
     
20. Write a function to accept a number 'n' and a)if n is negative then return 1. b)if n is positive and perfect number then return sqrt(n). c)if n is positive and not a perfect no. then return n(n+1)/2
Input : , Output :
    
Answer In:
No Discussion on this question yet!
Tags:
Virtusa
Answer In:
No Discussion on this question yet!
Tags:
Virtusa
Answer In:
No Discussion on this question yet!
Tags:
Virtusa
Answer In:
No Discussion on this question yet!
Tags:
Virtusa
Answer In:
No Discussion on this question yet!
Tags:
Virtusa
Answer In:
No Discussion on this question yet!
Tags:
Virtusa
Answer In:
No Discussion on this question yet!
Tags:
Virtusa
Answer In:
No Discussion on this question yet!
Tags:
Virtusa
Answer In:
No Discussion on this question yet!
Tags:
Virtusa
Answer In:
No Discussion on this question yet!
Tags:
Virtusa