How to find the given no is odd or even without checking of
any condition and loops. (Hint: Using array)
Answer Posted / 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 View All Answers
How do you declare a variable that will hold string values?
If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.
struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer
c language interview questions & answer
What is a node in c?
How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
What is the difference between text and binary i/o?
What is a pointer in c plus plus?
What is the difference between char array and char pointer?
The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none
Why main is not a keyword in c?
How does free() know explain how much memory to release?
How is = symbol different from == symbol in c programming?
Write a program to print “hello world” without using semicolon?
1) write a program to generate 1st n fibonacci prime numbers using Nested if 2) write a program to generate twin prime numbers from m to n using nested if 3) write a program to check whether a given integer is a strong number or not using nested if 4) Write a program to generate prime factors of a given integer using nested if 5)write a program to generate prime numbers from m to n using nested if 6)write a program to generate perfect numbers from m to n using nested if 7)write a program to generate the pallindromes from m to n using neste if 8)write a program to generate armstrong numbers from m to n using nested if 9)write a program to generate strong numbers from m to n using nested if