473,396 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

why is this result not valid? what's wrong?

Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2. #include<conio.h>
  3. #include<iostream.h>
  4. main()
  5. {
  6. int a,b;
  7. char d,i;
  8. atas:
  9. clrscr();
  10. printf("first input :");scanf("%i",&a);
  11. printf("second input   :");scanf("%i",&b);
  12. printf("select 1 for Bil. Ganjil and 0 for Bil. Genap [ 1 / 0] : ");scanf("%c",&i);
  13. i=getche();
  14. if (i=='1')
  15.     {
  16.      if(a%2==0)
  17.       {
  18.         a=a+1;
  19.       }
  20.     }
  21.   cout<<"\n";
  22.   while(a<=b)
  23.     {
  24.      cout<<a<<",";
  25.      a=a+2;
  26.      }
  27.  
  28. if(i=='0')
  29.     {
  30.      if (a%2!=0)
  31.       {
  32.         a=a+1;
  33.       }
  34.      }
  35.   cout<<"\n";
  36.   while(a<=b)
  37.      {
  38.       cout<<a<<",";
  39.       a=a+2;
  40.      }
  41. printf("Input again? [Y/T] : ");scanf("%c",&d);
  42. if(d=='Y'||d=='y')
  43.     {
  44.      goto atas;
  45.     }
  46.  {
  47.   getch();
  48.  }
  49. }
Apr 21 '13 #1
1 1295
weaknessforcats
9,208 Expert Mod 8TB
Maybe you could tell me what's not working?
Apr 21 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Noel Wood | last post by:
Hello I keep getting a warning ... Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in "name of my php file" when I run this query.... SELECT Menu_Item,...
8
by: Hostile17 | last post by:
Consider the following HTML. ---------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> <html> <head> <meta...
2
by: swhite76 | last post by:
I have a section of code that adds some double values and gives an incorrect result. This occurs with data that isn't really waht I would call high precision. An example is the following code...
23
by: James Aguilar | last post by:
Someone showed me something today that I didn't understand. This doesn't seem like it should be valid C++. Specifically, I don't understand how the commas are accepted after the function...
0
by: MrData | last post by:
Hi, I have a big problem with my recursive function. This function have the task to find all blocks in the template file out and put it recursive into a array. hierarchy of the blocks are...
1
by: clairelee0322 | last post by:
I am a c++ beginner and i am working on a dice loop lab. This program should roll two dice (each dice is from 1 to 6) and then total them together. The user should be able to input how many times...
5
by: Mubs | last post by:
Hi, I 'am trying to connect my sql database with my webpage for users log in. i have got this script so far but i keep getting the following error message which i cannot figure out.. could any1...
3
by: canabatz | last post by:
im using paging on this query: i got this code that returning wrong results: (SELECT bid_price, count(*) as n from bidding_details where bid_id=$bid_id GROUP BY bid_price DESC HAVING n = 1 ) ...
2
by: mingke | last post by:
Hi... So I have problem with my if condition..I don't know what's wrong but it keeps resulting the wrong answer.... So here's the part of my code I have problem with: for (i=0; i<size2;...
1
by: oimenoi | last post by:
I am keep having the "No overload for method 'GenerateSignature' takes 9 arguments" problem. Can you please tell me what is wrong with this class. This code is the sample from the Oauth.net . I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.