read a number & print all its devisors using c-program?
Answer Posted / vclingisetty@gmail.com
#include<stdio.h>
#include<conio.h>
void main()
{
int n,i;
clrscr();
printf("enter a number\n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
if(n%i==0)
printf("%d",i);
}
getch();
}
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Explain what happens if you free a pointer twice?
In C programming, what command or code can be used to determine if a number of odd or even?
How to write a code for reverse of string without using string functions?
What are the 5 types of inheritance in c ++?
Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.
PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE
What is difference between structure and union in c?
write a program to find the given number is prime or not
Explain modulus operator.
How to write c functions that modify head pointer of a linked list?
Explain what is wrong with this program statement? Void = 10;
Does c have an equivalent to pascals with statement?
Define Spanning-Tree Protocol (STP)
Why can arithmetic operations not be performed on void pointers?
A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler