Write a C program to check a number even or odd, without using
any relational, arithmetic operator and any loops.
Answer / geniuineprogrammer
u can use bitwise operator
if (no & 1) {
its odd
}
| Is This Answer Correct ? | 6 Yes | 1 No |
Explain what is the use of a semicolon (;) at the end of every program statement?
int array[]={1,2,3,4,5,6,7,8}; #define SIZE (sizeof(array)/sizeof(int)) main() { if(-1<=SIZE) printf("1"); else printf("2"); }
What is a structural principle?
.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }
class foo { public: static int func(const char*& p) const; }; This is illegal, why?
What is the difference between char a[] = "string"; and char *p = "string"; ?
14 Answers Adobe, Honeywell, TCS,
52.write a “Hello World” program in “c” without using a semicolon? 53.Give a method to count the number of ones in a 32 bit number? 54.write a program that print itself even if the source file is deleted? 55.Given an unsigned integer, find if the number is power of 2?
25 Answers Datamatics, Solartis, TCS, ThinkBox, Trine,
What does the message "automatic aggregate intialization is an ansi feature" mean?
What is this pointer in c plus plus?
What's the right way to use errno?
main() { int a,b; printf("%d,%d",scanf("%d%d",&a,&b)); } => do u mean above program's output... =>output will be:2,whatever you enter value for b. =>because scanf is a library fn which will return how many arguements it processes, and second value you are right mr.Satya but i found my self unable to understand that for the first time scanf returns the no of successful matches but how for the second time it returns the value of 'b'.while a function should return the same 'r' value every time.
What is a wrapper function in c?