Write a program to generate prime factors of a given integer?
Answer Posted / priyanka chauhan
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n;
clrscr();
printf("Enter the no: ");
scanf("%d",&n);
for(j=2;j<=n;j++)
{
if(n%j==0)
{
for(i=2;i<=j-1;i++)
{
if(j%i==0)
break;
}
if(i==j)
printf("%d ",j);
}
}
getch();
}
Is This Answer Correct ? | 23 Yes | 18 No |
Post New Answer View All Answers
how to print the character with maximum occurence and print that number of occurence too in a string given ?
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
Does sprintf put null character?
write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)
What is array of pointers to string?
Tell me with an example the self-referential structure?
a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above
What is the difference between if else and switchstatement
What is the difference between ‘g’ and “g” in C?
Is c is a low level language?
Suppose we have a table name EMP as below. We want to perform a operation in which, I want to change name ‘SMITH’ from as ‘SMITH JAIN’. Also I want to change the name of the column from ENAME to E_NAME. EMPNO ENAME JOB MGR HIREDATE SAL 7369 SMITH Coder 7902 17-DEC-80 800 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 7521 WARD SALESMAN 7698 22-FEB-81 1250
What are the valid places to have keyword “break”?
Explain bitwise shift operators?
What is #include conio h?