Write a program that takes a 5 digit number and calculates 2
power
that number and prints it.
Answer / aravind
#include<stdio.h>
#include<math.h> /*I am not sure whether this lib fun is gud*/
int main()
{
int num=12345,result;
result=pow(12345,2);
printf("result=%d",result);
}
| Is This Answer Correct ? | 3 Yes | 4 No |
How many parameters should a function have?
how to find the largest element of array without using relational operater?
What is #error and use of it?
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL
Explain the concept of "dangling pointers" in C.
What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }
What is the difference between union and structure in c?
What is the output from this program? #include <stdio.h> void do_something(int *thisp, int that) { int the_other; the_other = 5; that = 2 + the_other; *thisp = the_other * that; } int main(void) { int first, second; first = 1; second = 2; do_something(&second, first); printf("%4d%4d\n", first, second); return 0; }
What is volatile
what are the advantage of pointer variables? write a program to count the number of vowels and consonants in a given string
What are multidimensional arrays?
How to add two numbers without using arithmetic operators?
18 Answers College School Exams Tests, e track, Infosys, Pan Parag, Sapient, TCS,