Write a program that takes a 5 digit number and calculates
2 power
that number and prints it.
Answer Posted / usha
#include<stdio.h>
void main()
{
unsigned long int s=1;
int n;
scanf("%d%d",&n);
for(int i=0; i<n; i++)
{
s=s*2;
}
printf("result %ld",s);
getch();
}
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
Why is it usually a bad idea to use gets()? Suggest a workaround.
Is it possible to use curly brackets ({}) to enclose single line code in c program?
What is a protocol in c?
Which type of language is c?
Write a program to reverse a given number in c language?
Do you know what are the properties of union in c?
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
What is action and transformation in spark?
a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f
What is structure padding and packing in c?
How can I determine whether a machines byte order is big-endian or little-endian?
find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2
Is sizeof a keyword in c?
Why is c so popular?
What do you understand by friend-functions? How are they used?