hi all well this my first ever post here and i wanna learn from here as much i can.. i had many chances to learn c but took it for granted this time i really wanna do it.
still i am a begginer i am not able to develop logics i.e i know things how to do them but i can implement them in C language plz help me....
from last two days i struggling through a program i dont know how should i solve it
program is:- two prime no.s are said to be twin if they differ by 2 such as 11 and 13,17-19,etc
WAP to print all TWO digit twin prime numbers
I cud just try how to check whether a number is prime or not plz check my code
Code:#include<stdio.h> main() { int n,i; printf("\n please enter the number to check whether a prime or not); scanf("%d",&n); for(i=2;i<n;i++) { if(n%i==0) { printf("\n no. is not prime"); return; } else { if(n==i) printf(" no is prime); }}}
please do tell me how can i make problems solving simpler. do guide me please i am dying to learn c