Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.


Please wait...

Programs Questions and Answers



    Question :: 271
    Write a program to print odd number in descending order from 1-10.

    Input : NA


    Output : NA

    View Answer View Answer |  Basics |  Discuss in Forum | Add to Reading List To Reading List | Tag to companies Asked In |  Fresher
    Answer In: C  
     
    <p>#include<stdio.h><br />
    #include<conio.h><br />
    void main()<br />
    {<br />
        int i,j=2;<br />
        for(i=10;i>=1;i--)<br />
        {<br />
            if(i%j==1)<br />
            {<br />
                printf("%d",i);<br />
            }<br />
        }<br />
    }</p>

    Tags:TCS

    Question :: 272
    Write a Program to generate random numbers.

    Input : NA


    Output : NA

    View Answer View Answer |  Basics |  Discuss in Forum | Add to Reading List To Reading List | Tag to companies Asked In |  Fresher
    Answer In: C  
     
    #include <stdio.h>
    #include <stdlib.h>
     
    int main() {
      int c, n;
     
      printf("Ten random numbers in [1,100]\n");
     
      for (c = 1; c <= 10; c++) {
        n = rand() % 100 + 1;
        printf("%d\n", n);
      }
     
      return 0;
    }

    Tags:TCS

    Question :: 273
    Write a program to search duplicate characters in a string.

    Input : NA


    Output : NA

    View Answer View Answer |  Strings |  Discuss in Forum | Add to Reading List To Reading List | Tag to companies Asked In |  Fresher
    Answer In:
     No Discussion on this question yet!

    Tags:Capgemini

    Question :: 274
    Write a program to sorting a string in alphabetical order.

    Input : NA


    Output : NA

    View Answer View Answer |  Strings |  Discuss in Forum | Add to Reading List To Reading List | Tag to companies Asked In |  Fresher
    Answer In:
     No Discussion on this question yet!

    Tags:Capgemini

    Question :: 275
    Write a program enter the sentence then print it in reverse order.

    Input : NA


    Output : NA

    View Answer View Answer |  Strings |  Discuss in Forum | Add to Reading List To Reading List | Tag to companies Asked In |  Fresher
    Answer In: JAVA  
     
    import java.io.*;
    public class ReverseWord 
    {
     public static void main(String[] args) 
     { 
      BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
      System.out.println("Enter the string"); 
      String str=br.readLine();
      String a[]=str.split(" ");
      for(int i=a.length-1; i>=0; i--)
      {
       System.out.print (a[i]+" ");
      }
     }

    Tags:IBM

    Question :: 276
    Write a program enter a string then convert it into upper case.

    Input : NA


    Output : NA

    View Answer View Answer |  Strings |  Discuss in Forum | Add to Reading List To Reading List | Tag to companies Asked In |  Fresher
    Answer In: JAVA  
     
    import java.util.*;
    import java.lang.*;
    import java.io.*;

    class Ideone
    {
     public static void main (String[] args) throws java.lang.Exception
     {
      
     BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
     String str=br.readLine();
     int l=str.length();
     for(int i=0;i<l;i++)
     {
      char ch=str.charAt(i);
      if(Character.isUpperCase(ch))
      {
       System.out.print(Character.toLowerCase(ch));
      }
      else if(Character.isLowerCase(ch))
      System.out.print(Character.toUpperCase(ch));
      else
      System.out.print(ch);
     } 
    }
    }

    Tags:IBM

    Question :: 277
    Write a program to count the no. of words in the given string?

    Input : hello world


    Output : 2

    View Answer View Answer |  Strings |  Discuss in Forum | Add to Reading List To Reading List | Tag to companies Asked In |  Fresher
    Answer In: C  
     
    <p>#include <stdio.h><br />
    #include <string.h><br />
    int main()<br />
    {<br />
      char str[50];<br />
      int count=0,i;<br />
      printf("enter any string : ");<br />
      scanf("%[^\n]s",str);<br />
      for(i=0;str[i]!='\0';i  )<br />
      {<br />
          if(str[i]==' ')<br />
              count  ;<br />
      }<br />
      printf("reverse string is : %d\n",count 1);<br />
      <br />
    }</p>

    Tags:Virtusa

    Question :: 278
    Write a program to check & count the occurrence of character in the given string?

    Input : NA


    Output : NA

    View Answer View Answer |  Strings |  Discuss in Forum | Add to Reading List To Reading List | Tag to companies Asked In |  Fresher
    Answer In: C  
     
    <p>include <stdio.h></p>

    <h2 style="font-style:italic;">int main()<br />
    {<br />
       char str[10];<br />
       int c=0,count[26]={0},x;<br />
       scanf("%s",str);<br />
       for(int i=0;str[i]!='\0';i  ){<br />
           if(str[i]>='a'

    Tags:Virtusa

    Question :: 279
    Write a program to check whether given date is valid or not?

    Input : 1. DDMMYYYY :: 24092017 2. DDMMYYYY :: 54142017


    Output : 1. Valid 2. Invalid

    View Answer View Answer |  Strings |  Discuss in Forum | Add to Reading List To Reading List | Tag to companies Asked In |  Fresher
    Answer In: JAVA  
     
    <p>import java.text.DateFormat;<br />
    import java.text.ParseException;<br />
    import java.text.SimpleDateFormat;<br />
    import java.util.Scanner;</p>

    <p>class DateValid {</p>

    <p>    public static void main(String[] args) {</p>

    <p>        Scanner input = null;<br />
            try {<br />
                input = new Scanner(System.in);<br />
                System.out.println("Enter date in dd/MM/yyyy format : ");<br />
                String date = input.next();<br />
                if (isDateValid(date)) {<br />
                    System.out.println("Date is valid.");<br />
                } else {<br />
                    System.out.println("Date is not valid.");<br />
                }<br />
            } finally {<br />
                if (input != null) {<br />
                    input.close();<br />
                }<br />
            }<br />
        }</p>

    <p>    private static boolean isDateValid(String date) {</p>

    <p>        boolean result = false;</p>

    <p>        if (isValidDateFormat(date)) {<br />
                DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");<br />
                dateFormat.setLenient(false);<br />
                try {<br />
                    dateFormat.parse(date);<br />
                    result = true;<br />
                } catch (ParseException e) {<br />
                    result = false;<br />
                }<br />
            }<br />
            return result;<br />
        }</p>

    <p>    private static boolean isValidDateFormat(String date) {<br />
            String pattern = "(0?[1-9]|[12][0-9]|3[01])\\/(0?[1-9]|1[0-2])\\/([0-9]{4})";<br />
            boolean result = false;<br />
            if (date.matches(pattern)) {<br />
                result = true;<br />
            }<br />
            return result;</p>

    <p>    }</p>

    <p>}</p>

    Tags:Virtusa

    Question :: 280
    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 : NA


    Output : NA

    View Answer View Answer |  Strings |  Discuss in Forum | Add to Reading List To Reading List | Tag to companies Asked In |  Fresher
    Answer In:
     No Discussion on this question yet!

    Tags:Virtusa