ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage   interview questions urls   External Links  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
Program to find the value of e raised to power x using while
loop
 Question Submitted By :: Vaasu
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Program to find the value of e raised to power x using while loop
Answer
# 1
#include<stdio.h>

void main()
 {
    int sum,n;
    fact x,y;
 
  printf("Enter the exponential(E) value");
  scanf("%f ",y);

  printf("Enter the value for x");
  scanf("%f",x);

  printf("No. of times x is to be multiplied");
  scanf("%d",n);

  while(e=n)
   {
     sum=x^n;   
     printf("The result of expression is =%d",sum);
     printf("Check this out%d");
   }
}
 
Is This Answer Correct ?    0 Yes 1 No
Amit
 
  Re: Program to find the value of e raised to power x using while loop
Answer
# 2
#include<stdio.h>
void main()
{
	int i=1,e,x,s,p=1;
	printf("Enter e and x :");
	scanf("%d%d",&e,&x);
	while(i<=x)
	{
	    p=p*e;
            i++;
	}
       
	printf("power is %d ",p);
}

here pow(e,x) is calculated using this program.
 
Is This Answer Correct ?    0 Yes 1 No
Pragathi
 
 
 
  Re: Program to find the value of e raised to power x using while loop
Answer
# 3
#include<stdio.h>
#include<math.h>
main()
{
int i,j,n,x,fact=1;
float c,t,sum=1;
printf("enter the value of x and n);
scanf("%d%d",&x,&n);
while(i<n-1)
{
c=pow(x,i);
for(j=1;j<i;j++)
fact=fact*j;
t=c/fact;
sum=sum+t;
}i=i+1;
printf("the sum of series is %f",sum);
getch();
}
 
Is This Answer Correct ?    0 Yes 0 No
S.d.bahinipati
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
WHY DO WE USE A TERMINATOR IN C LANGUAGE?  2
what is the use of #pragma pack, wer it is used?  1
Write a program that takes three variables(a,b,c) in as separate parameters and rotates the values stored so that value a goes to b,b,to c and c to a  2
What is memmove? Oracle1
main() { clrscr(); } clrscr(); ME3
a.One Cannot Take the address of a Bit Field b.bit fields cannot be arrayed c.Bit-Fields are machine Dependant d.Bit-fields cannot be declared as static Which of the Following Statements are true w.r.t Bit-Fields A)a,b&c B)Only a & b C)Only c D)All Accenture2
void main() { int i=5; printf("%d",i++ + ++i); } ME6
will u give me old quesrion papers for aptitude for L & t info tech? L&T1
10. Study the code: void show() main() { show(); } void show (char *s) { printf("%sn",s); } What will happen if it is compiled & run on an ANSI C Compiler? A)It will compile & nothing will be printed when it is executed B)it will compile but not link C)the compiler will generate an error D)the compiler will generate a warning Accenture4
write a program to generate 1st n fibonacci prime number  1
program to find middle element of linklist? Huawei1
write a program to sort the elements in a given array in c language  2
when will be evaluated as true/ if(x==x==x) a) x=1; b) x=0; c) x=-1; d) none HCL3
how we can make 3d venturing graphics on outer interface Microsoft1
Which of the following is not an infinite loop ? a.while(1){ .... } b.for(;;){ ... } c.x=0; do{ /*x unaltered within theloop*/ ... }while(x==0); d.# define TRUE 0 ... while(TRUE){ .... } TCS4
what is the difference between declaration ,defenetion and initialization of a variable? LG-Soft4
6. Which of the Following is not defined in string.h? A)strspn() B)strerror() C)memchr() D)strod() Accenture1
write a program to find out number of on bits in a number? Huawei11
WAP TO ACCEPT STRING AND COUNT A COMES N TIMES B COMES N TIMES C COMES N TIMES D COMES N TIMES AND SO ON......... AT LAST UNTIL Z COMES N TIMES...............  2
disadvantages of realloc ? HCL1
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com