find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / d.c.sathishkumar
#include<stdio.h>
main()
{
int n;
char *p[]={"Even","odd"};
Printf("Enter the number");
scanf("%d",&n);
n=n%2;
printf("The value is %s",a[n]);
}
| Is This Answer Correct ? | 17 Yes | 8 No |
Post New Answer View All Answers
write a proram to reverse the string using switch case?
What is 1f in c?
Explain how can a program be made to print the line number where an error occurs?
What is the use of getchar functions?
What is a scope resolution operator in c?
A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
Describe explain how arrays can be passed to a user defined function
Define and explain about ! Operator?
Explain what is the advantage of a random access file?
Is c easier than java?
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
How can I read/write structures from/to data files?
How can I find out how much free space is available on disk?
Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.