Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to find the given no is odd or even without checking of
any condition and loops. (Hint: Using array)

Answers were Sorted based on User's Feedback



How to find the given no is odd or even without checking of any condition and loops. (Hint: Using ..

Answer / amala v

import java.io.*;
public class even {
public static void main(String arg[])throws
IOException
{
String a[]={"even","odd"};
BufferedReader br=new BufferedReader(new
InputStreamReader(System.in));
int n;
System.out.println("Enter no to find");
n=Integer.parseInt(br.readLine());
n=n%2;
System.out.println("given no is "+a[n]);

}

}

Is This Answer Correct ?    12 Yes 3 No

How to find the given no is odd or even without checking of any condition and loops. (Hint: Using ..

Answer / vaishu

void main()
{
int n;
char s[]={"even","odd"};
printf("Enter the no.:");
scanf("%d",&n);
n=n%2;
printf("th no. is %s",s[n]);
getch();
}

Is This Answer Correct ?    12 Yes 7 No

How to find the given no is odd or even without checking of any condition and loops. (Hint: Using ..

Answer / ligory antony

void main()
{
int n;
char *s[4]={"even","odd"};
printf("Enter the no.:");
scanf("%d",&n);
n=n%2;
printf("th no. is %s",s[n]);
getch();
}

Is This Answer Correct ?    6 Yes 4 No

How to find the given no is odd or even without checking of any condition and loops. (Hint: Using ..

Answer / anandi

void main()
{
int n;
char s[20][20]={"even","odd"};
printf("Enter the no.:");
scanf("%d",&n);
n=n%2;
printf("th no. is %s",s[n]);
getch();
}

Is This Answer Correct ?    3 Yes 3 No

Post New Answer

More C Interview Questions

What is the difference between typedef and #define?

0 Answers  


Write a c pgm for leap year

11 Answers   College School Exams Tests, IBM, TCS,


What is the main differences between C and Embedded C?

9 Answers  


what is ur strangth & weekness

0 Answers   Cognizant, LG Soft, NetEnrich,


What is the difference between mpi and openmp?

0 Answers  


how can you print&scan anything using just one character? :) HINT: printf,scanf similer

2 Answers  


what is the difference between strcpy() and memcpy() function?

2 Answers  


code for replace tabs with equivalent number of blanks

0 Answers   Bosch,


what will be printed by this printf? printf("%c",printf("hi")["sharkselva"])); }

3 Answers   HCL,


plz let me know how to become a telecom protocol tester. thank you.

0 Answers  


Can you assign a different address to an array tag?

0 Answers  


Write a program to display the no of bit difference between any 2 given numbers eg: Num1 will 12->1100 Num2 will 7->0111 the difference in bits are 2.

4 Answers  


Categories