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  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
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 ?    9 Yes 6 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 ?    5 Yes 5 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 ?    5 Yes 2 No
S.d.bahinipati
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
Write a Program to print this triangle: * ** * **** * ****** * ******** * ********** use two nested loops. TCS5
Which of the following about the C comments is incorrect ? a.commentscan go over multiple lines b.comments can start any where in the line c.a line can contain comments with out any language statements d.comments can occur within comments TCS6
What are Storage Classes in C ? HP15
How can I allocate arrays or structures bigger than 64K?  4
Who had beaten up hooligan "CHAKULI" in his early college days?  1
without using arithmatic operator convert an intger variable x into x+1  1
Reverse the part of the number which is present from position i to j. Print the new number.[without using the array] eg: num=789876 i=2 j=5 778986  2
Write a program to exchange two variaables without temp Geometric-Software6
what is the output of the following program? #include<stdio.h> void main() { int x=4,y=3,z; z=x-- -y; printf("\n%d %d %d",x,y,z); }  10
difference between semaphores and mutex?  1
Convert the following expression to postfix and prefix (A+B) * (D-C) Satyam2
wats the diference btwen constant pointer and pointer to a constant.pls give examples.  6
Can we write a program without main() function?  9
what is the difference between #include<stdio.h> and #include"stdio.h" ? TCS5
5. What kind of sorting is this: SORT (k,n) 1.[Loop on I Index] repeat thru step2 for i=1,2,........n-1 2.[For each pass,get small value] min=i; repeat for j=i+1 to N do { if K[j]<k[min] min=j; } temp=K[i];K[i]=K[min];K[min]=temp; 3.[Sorted Values will be returned] A)Bubble Sort B)Quick Sort C)Selection Sort D)Merge Sort Accenture2
Describe advantages and disadvantages of the various stock sorting algorithms Microsoft1
How to access or modify the const variable in c ? HP4
what is Structural oriented language? give some example of this language.....?  1
How do you write a program which produces its own source code as its output?  2
#include <stdio.h> #define sqr(x) (x*x) int main() { int x=2; printf("value of x=%d",sqr(x+1)); } What is the value of x? Oracle13
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

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