To divide a number by 4 without using a divide operator, we can use the right shift operator >> that shifts the last bit. Since you can’t use loops or goto statements, the only valid method is using the recursive functions. See your article appearing on the GeeksforGeeks main page and help other Geeks. It will return the positive difference between the numbers and we will and subtract this absolute difference to find the max and min of the two given numbers. code. Attention reader! They are −. Following are the some basic tricky questions in C language. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready. Experience. Program to verifies the condition inside if block. C++ Programs To Create Pyramid and Pattern. The below program shows how to. What is default constructor in C# programs? If the bit at 0th position is 1 then the number is odd otherwise it is even. By using our site, you Here are 10 tricky programs that will test your programming basics. The bitwise & operator along with 0x01 will check for the bit at the 0th position in the number. C Programming Tricky Questions and answers for freshers, beginners & people who are preparing for the interview or conducting the interview. C program to print all leap years from 1 to N. C program to calculate employee gross salary. Program to find Maximum and minimum of two numbers without using any loop or condition. Please write to us at contribute@geeksforgeeks.org to report any issue with the above content. C program to check whether a number if Armstrong or not. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. To check if two numbers are equal without using arithmetic operators or comparison operators. First C program to print "Hello World". We can do this by using the return type of the output method, printf. Now, let’s implement this concept in a program. How to compile and execute C# programs on Linux? Calculating recursive sum by adding all digits of the number and then see if it is single digit then stop otherwise recalculate the sum until the sum becomes single digit. Print the maximum value of an unsigned int using One’s Compliment (~) Operator in C. To find sum of two integers without using ‘+’ operator. To print the source code of the program as the output of the same program is a bit of a tricky question and needs quite a good understanding of the programming language to do. A sum of two numbers can be found without using the + operator by using the - operator multiple times in the code. To check for equality of two numbers we can use the bitwise XOR operator (^). This may seem easy but beginners may get puzzled while printing text within double quotes. Program to divide an integer by 4 without using ‘/’ operator. In C++ programming language, we use quotes to denote the start and end of the text is to be printed. Please use ide.geeksforgeeks.org, generate link and share the link here. C program to check whether a number if Even or Odd. We use cookies to ensure you have the best browsing experience on our website. Initialize a vector in C++ (5 different ways), Write Interview This article is contributed by Smitha Dinesh Semwal. C program to swap two numbers without using third variable. In c/c++ programming language there are methods to print something without using a semicolon. To print the source code of the program as the output of the same program is a bit of a tricky question and needs quite a good understanding of the programming language to do. Here is a list of such programs :-, edit To find the maximum and a minimum number of the two numbers that are defined without using a comparison operator we will make use of the abs method, and passing the difference of the two numbers to it. May be in technical interviews, coding tests, or in C/C++ classrooms. Writing code in comment? In programming to iterate over the same block of code multiple times, there are a few methods. Print a number 100 times without using loop, recursion and macro expansion in C?