You need 2 loops
1)to traverse from firstnum to secondnum
2)to traverse from 2 to currentnum and check if it is divisible(remainder is 0)[This is how you find if the number is prime or not]
Type: Posts; User: subhash.rao
You need 2 loops
1)to traverse from firstnum to secondnum
2)to traverse from 2 to currentnum and check if it is divisible(remainder is 0)[This is how you find if the number is prime or not]
You can have two arrays like
char plaintext[26];
char ciphertext[26];
plaintext containing all alphabets...u could write a loop and use ASCII values...
Have a string to take the keyword
Please do avoid global variables...I have just tweaked your program....
#include <iostream>
using namespace std;
dude is this some assignment or for your lab.....
If it is your own problem for which ur coding then FIRST change ur compiler first....either use Pellas C or Code Blocks.....
which college are...
for developing apps for a apple product like iPhone,iPod Touch which have iOS u should develop apps in XCode...
there are too many mistakes in the code...all the variables are local to the functions which do not affect the local variables of main from which u are trying to get price,item,etc...even display...
h edited the post...check post #2 please...
Maybe he had used a macro
#define dbl double
...try adding it...
EDIT:that made me think its a macro...but he edited the entire post....
check the things i have pointed out...can u give an example of such numbers....like tell the sample multplicand and multiplier which satisfies your condition...including the digits in partial and...
pleas check ur code....
u need to compile the other .c files with it...
i.e
gcc main.c mod1.c mod2.c -I /home/username/code/folder
a while loop addressing (|x|>tol)
like
while(|x|>tol)
{
//do stuff A
}
//do stuff B
u could use a do while loop like this....
x = guess*guess - n;
do
{
if (x>0)
{
tooHigh = guess;
changes
1) change main() to int main(void)
2)move the card=rand()%52+1; to the first statement of the loop...so u get different cards for each draw...and u are not checking whether the card is...
u can use isaplha function present in ctype.h to check whether the entered value is a alphabet or not......
ya...it should work...but if some one enters a digit for the first place it will print line # 2...
instead of checking first with each alphabet try...
if(name[0]<'n')
{
printf("\nLine # 2");
}
else
{
printf("\nLine # 1");
yes it is correct now...
sorry my mistake..
what matticus is trying to say is use
do
{
if (num < min)
num = min;
else if (num > max)
num = max;
else num = num;
...
I will suggest u a few changes...
1)change main() to int main(void)
2)assign min to the maximum number that can be inputted lik say min=9999
3)change the line num=min to min=num
4)change the line...
I was just trying to point out u may get undesirable output for some inputs....
Anyway u r right..
hehe..:eek:
I said to remove condition because if u add if and make it else if(nbal < cred1) what will happen if for some input nbal is equal to cred1..for that u have write a seperate else again..correct me if...
check the else line...remove the condition after else it will work....
and you could also reduce the code by removing redundant input of account number..