0

PLEASE SOLVE THIS ONE . BUT YOU CAN ONLY USE THE CONCEPTS OF IF-ELSE , LOOPS AND FUNCTION. DONT USE POINTERS ARRAYS OR RECURSION

https://code.sololearn.com/cDhO3jxo3pKa/?ref=app

1st Nov 2022, 4:15 PM
Ashish Raj
Ashish Raj - avatar
10 Respuestas
+ 4
Sir Jayakrishna🇮🇳 has explained well but still I wanna share it cuz I've made it: https://code.sololearn.com/cyyWiVF9iU2M/?ref=app
1st Nov 2022, 4:43 PM
Just Some Random Guy
Just Some Random Guy - avatar
+ 4
You missed semicolon in line 7 at end. Remove line 17. Loop start from 1. If you are looking a prime factors only then you need to find I is prime or n o t before printing.
1st Nov 2022, 4:24 PM
Jayakrishna 🇮🇳
+ 2
Jayakrishna🇮🇳 Man I have not completed the code because I don't further or i'm just exhausted . please provide me the solution.
1st Nov 2022, 4:29 PM
Ashish Raj
Ashish Raj - avatar
+ 2
#include <stdio.h> void factors(int); int main() { int num; printf("enter the positive integer: \n"); scanf("%d",&num); factors(num); return 0; } void factors (int num){ int i; for(i=1;i<=num;i++){ if(num%i==0) { //for(j=2;j<=i;j++) printf ("%d ",i); } } // a prime number is a number which have only factors 1 and itself. implement this to function, and replace like: if( isprime(i) ) printf("%d", I);
1st Nov 2022, 4:33 PM
Jayakrishna 🇮🇳
+ 2
Jayakrishna🇮🇳 sir i want you to be my mentor as well. Could you guide me through this programming journey?
1st Nov 2022, 4:40 PM
Ashish Raj
Ashish Raj - avatar
+ 2
Snehil Pandey dont use another preprosessor directive, i have only studied if else , loops, and function.
1st Nov 2022, 4:52 PM
Ashish Raj
Ashish Raj - avatar
+ 2
Snehil Pandey thank you very much
1st Nov 2022, 5:07 PM
Ashish Raj
Ashish Raj - avatar
+ 1
21C47 Ashish Raj check again it's edited
1st Nov 2022, 5:01 PM
Just Some Random Guy
Just Some Random Guy - avatar
+ 1
Great
2nd Nov 2022, 3:51 PM
Asim Farheen ⭐⭐🤺👿👿
Asim  Farheen ⭐⭐🤺👿👿 - avatar
+ 1
Great, thanks.
3rd Nov 2022, 11:59 AM
Asim Farheen ⭐⭐🤺👿👿
Asim  Farheen ⭐⭐🤺👿👿 - avatar