Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


4) Write a program that takes a 5 digit number and
calculates 2 power
that number and prints it.
I did the following program and is this correct



4) Write a program that takes a 5 digit number and calculates 2 power that number and prints it. ..

Answer / renu gaindar

#include <stdlib.h>
#include <string.h>
#include <stdio.h>

void main()
{
int a[5],b[5],c[2],j[2],d[2];
int d,e,f,g,h,i,l,result;
char first[10], secont[10],third[10],forth[10],fifth
[10],x[20];
printf("\nEnter 5 digit number : ");
for(i=1,i<=5;i++)
{
scanf("%d",a[i]);
}
c=a[5]*a[5]; //multiplication of units place
d[1]=c[1]; //1st carry
e=c[0]; //First Digit

c=a[4]*a[4];
d[1]=c+d;
f=c[0];

c=(a[3]*a[3]);
d[1]=c+d;
g=c[0];

c=(a[2]*a[2]);
d[1]=c+d;
h=c[0];

c=(a[1]*a[1]);
d[1]=c+d;
l=c[0];

atoi(e,first,10);
atoi(f,second,10);
atoi(g,third,10);
atoi(h,forth,10);
atoi(l,fifth,10);

strcpy(x,first);
strcpy(x,second);
strcpy(x,third);
strcpy(x,forth);
strcpy(x,fifth);

result=atoi(x);
printf("%d",result);

}

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Engineering AllOther Interview Questions

What kind of question can be asked at the time of Interview for State Bank Of India Clerical Interview

0 Answers  


21. Find d Odd one out? a. LINUX b. WINDOWS 98 c. SOLARIS d. SMTP b. JAVA b. LISP c. Small talk d. Eiffel c. HTTP b. ARP c. SMTP d. SAP d. Linux b.windows NT c. SQL server d. UNIX e. SAP b. ARP c. WAP d.TCP IP f. Oracle b. Linux c. Ingress d. DB2 g. SMTP b. WAP c. SAP d. ARP h. WAP b. HTTP c. BAAN d. ARP i. SQL b. DB2 c. SYBASE d. HTTP

3 Answers   TCS, Tech Mahindra,


how configur net and vpn on cisco product

0 Answers   Microsoft,


if the bit string 0111101111101111110 is bit stuffed,what is the output string?

3 Answers  


how to calculate when (-) sign givcn in the power number for example 125^-5

1 Answers  


WHAT IS THE MEANING OF FLASHING VD AND FD INSTALLATION PLENIUM BOXES IN CENTRAL AIR CONDITION

0 Answers  


model question papers of GrayOrange company

0 Answers   Orange,


how to create user name stape by stape in cisco router {with command}

0 Answers  


how is the config take place and from reciever side how will process the data into internal table

0 Answers  


how much lighting lux need for a common walking area at night time

0 Answers  


What suggestions would you give to include quality, as well as, the production capability into design?

0 Answers  


3. Tell me about a time when you had too many things to do and you were required to prioritize your tasks.

0 Answers   Strad Energy,


Categories
  • Civil Engineering Interview Questions Civil Engineering (5086)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4453)
  • Electrical Engineering Interview Questions Electrical Engineering (16638)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1095)
  • Aeronautical Engineering Interview Questions Aeronautical Engineering (239)
  • Bio Engineering Interview Questions Bio Engineering (96)
  • Metallurgy Interview Questions Metallurgy (361)
  • Industrial Engineering Interview Questions Industrial Engineering (259)
  • Instrumentation Interview Questions Instrumentation (3014)
  • Automobile Engineering Interview Questions Automobile Engineering (332)
  • Mechatronics Engineering Interview Questions Mechatronics Engineering (97)
  • Marine Engineering Interview Questions Marine Engineering (124)
  • Power Plant Engineering Interview Questions Power Plant Engineering (172)
  • Textile Engineering Interview Questions Textile Engineering (575)
  • Production Engineering Interview Questions Production Engineering (25)
  • Satellite Systems Engineering Interview Questions Satellite Systems Engineering (106)
  • Engineering AllOther Interview Questions Engineering AllOther (1379)