If input is 123 then how to print 100 and 20 and 3 seperately?
Answer Posted / 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 |
Post New Answer View All Answers
Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.
Is c dynamically typed?
Can you write the function prototype, definition and mention the other requirements.
What are the 32 keywords in c?
Explain what are the different file extensions involved when programming in c?
Explain the use of bit fieild.
Explain what is operator promotion?
Why isnt there a numbered, multi-level break statement to break out
What is hashing in c?
What is the meaning of ?
a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion
What oops means?
What is the role of && operator in a program code?
The purpose of this exercise is to benchmark file writing and reading speed. This exercise is divided into two parts. a). Write a file character by character such that the total file size becomes approximately >10K. After writing close the file handler, open a new stream and read the file character by character. Record both times. Execute this exercise at least 4 times b). Create a buffer capable of storing 100 characters. Now after generating the characters, first store them in the buffer. Once the buffer is filled up, store all the elements in the file. Repeat the process until the total file size becomes approximately >10K.While reading read a while line, store it in buffer and once buffer gets filled up, display the whole buffer. Repeat the exercise at least 4 times with different size of buffer (50, 100, 150 …). Records the times. c). Do an analysis of the differences in times and submit it in class.
Why is c fast?