Write a program that takes a 5 digit number and calculates
2 power that number and prints it(should not use big
integers and exponential functions)
Answer Posted / nitin katakdound
int main(int argc, char *argv)
{
long two_power, five_digit_number;
if(scanf("%ld",&five_digit_number)){
two_power = five_digit_number*five_digit_number;}
printf("\n 2 power of that number is %ld",two_power);
return 0;
}
| Is This Answer Correct ? | 13 Yes | 29 No |
Post New Answer View All Answers
What is New modifiers?
What is scope rule of function in c?
What does 3 periods mean in texting?
In cryptography, you could often break the algorithm if you know what was the original (plain) text that was encoded into the current ciphertext. This is called the plain text attack. In this simple problem, we illustrate the plain text attack on a simple substitution cipher encryption, where you know each letter has been substituted with a different letter from the alphabet but you don’t know what that letter is. You are given the cipherText as the input string to the function getwordSets(). You know that a plain text "AMMUNITION" occurs somewhere in this cipher text. Now, you have to find out which sets of characters corresponds to the encrypted form of the "AMMUNITION". You can assume that the encryption follows simple substitution only. [Hint: You could use the pattern in the "AMMUNITION" like MM occurring twice together to identify this]
what will be maximum number of comparisons when number of elements are given?
What is the purpose of scanf() and printf() functions?
Explain how can I make sure that my program is the only one accessing a file?
In C, What is the #line used for?
What functions are in conio h?
what is stack , heap ,code segment,and data segment
Explain what is the benefit of using an enum rather than a #define constant?
What is a null string in c?
how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions
Explain what is a const pointer?
What is the code in while loop that returns the output of given code?