4) Write a program that takes a 5 digit number and
calculates 2 power
that number and prints it.
i have done maximum par but i m findind problem in the
commented area.
please help...

Answer Posted / ansh

#include<stdio.h>
void main()
{
int a;
long int b=1;
scanf("%d",&a);
printf("%d\n",a);
b=b<<a;
printf("%lu",b);
getch();
}

Is This Answer Correct ?    1 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When should the register modifier be used? Does it really help?

613


if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above

713


Which are low level languages?

636


#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }

772


What is #pragma statements?

589






What is binary tree in c?

622


Why header files are used?

646


What is pass by reference in functions?

323


How many types of operators are there in c?

615


what do you mean by inline function in C?

618


Can we change the value of static variable in c?

564


How is actual parameter different from the formal parameter?

591


What is difference between && and & in c?

597


what is ur strangth & weekness

1820


Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.

652