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...


If input is 123 then how to print 100 and 20 and 3 seperately?

Answers were Sorted based on User's Feedback



If input is 123 then how to print 100 and 20 and 3 seperately?..

Answer / letskools

#include<stdio.h>
#include<conio.h>
void main()
{
int a[5];
int i, j,rem,k=0,x=1;
int num;
printf("enter any number");
scanf("%d",&num);
while(num>0)
{
rem = num % 10;
a[k] = rem * x;
x *= 10;
k++;
num /= 10;
}
for (i = k-1; i >= 0; i--)
{
printf("%d\n"a[i]);
}
getch();
}

Is This Answer Correct ?    6 Yes 0 No

If input is 123 then how to print 100 and 20 and 3 seperately?..

Answer / charusheela

#include<stdio.h>
#include<conio.h>
void main(){
int num=123,r,i=1;
clrscr();
while(num)
{
r=num%10;
printf("%d\n",r*i);
i*=10;
num/=10;
}
getch();
}

Is This Answer Correct ?    2 Yes 0 No

If input is 123 then how to print 100 and 20 and 3 seperately?..

Answer / dhruv sharma rkdf

#include<stdio.h>
#include<conio.h>
void main(){
int n,temp,i=1;
clrscr();
printf("enter number:");
scanf("%d",&n);
for(;n>0;n=n/10){
temp=(n%10)*i;
i*=10;
printf("%d\n",temp)
}
getch();
}

Is This Answer Correct ?    1 Yes 0 No

If input is 123 then how to print 100 and 20 and 3 seperately?..

Answer / cute_boy4434

PLz reply me soon . ya

Is This Answer Correct ?    3 Yes 3 No

Post New Answer

More C Interview Questions

52.write a “Hello World” program in “c” without using a semicolon? 53.Give a method to count the number of ones in a 32 bit number? 54.write a program that print itself even if the source file is deleted? 55.Given an unsigned integer, find if the number is power of 2?

25 Answers   Datamatics, Solartis, TCS, ThinkBox, Trine,


What is static and volatile in c?

0 Answers  


what is use#in c

3 Answers  


What are the various types of control structures in programming?

0 Answers  


What are extern variables in c?

0 Answers  


how many keywords are available in 'c' language a) 32 b) 34 c) 45 d) 48

1 Answers  


Why is sprintf unsafe?

0 Answers  


prototype of sine function.

2 Answers   Cadence,


Read N characters in to an array . Use functions to do all problems and pass the address of array to function. 2. Enter alphanumeric characters and form 2 array alphaets and digits.Also print the count of each array.

0 Answers  


Total of how many functions are available in c?

3 Answers  


What are shell structures used for?

0 Answers  


Compare array data type to pointer data type

0 Answers  


Categories