473,394 Members | 1,854 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,394 software developers and data experts.

Logical Operations and Loops

Hi, I'm in desperate need of help. My exam is in 2 days and I dont understand anything covering the logical operations and Loops. The format for my exam is simply to convert a few things into C codes. ex: convert 10>x>5 into C codes. The way I would approach it would be X>5 && X<10, what is the difference then with X>5 II X<10? another part of my exam would be determining the output of a program given the codes. I always get confused with the loops and the formats for it. How do you use,"Do" "While" "switch" and "for"? What is the format?
Aug 3 '07 #1
1 1321
Meetee
931 Expert Mod 512MB
Hi, I'm in desperate need of help. My exam is in 2 days and I dont understand anything covering the logical operations and Loops. The format for my exam is simply to convert a few things into C codes. ex: convert 10>x>5 into C codes. The way I would approach it would be X>5 && X<10, what is the difference then with X>5 II X<10? another part of my exam would be determining the output of a program given the codes. I always get confused with the loops and the formats for it. How do you use,"Do" "While" "switch" and "for"? What is the format?
Hi,

&& and || has a big difference. X>5 && x<10 means if x>5 and x<10 both are true then only......In this condition if x= 15 then it's not valid as though 15>5 but not <10. x=7 (for eg) can work here.

In || it's a sort of reverse case. Either x>5 or x<10 can work. Here if x=15 then condition is true as x>5 is true for 15.

For loops I would suggest you to read these links.
Link1
Link2

Good Luck!!
Aug 3 '07 #2

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

Similar topics

3
by: Andrew Durdin | last post by:
In Python, you can override the behaviour of most operators for a class, by defining __add__, __gt__, and the other special object methods. I noticed that, although there are special methods for...
4
by: muser | last post by:
Can anyone run this program through their compiler or if they can see a logical error please point it out. I have my tutor working on it at the moment but I would rather a less ambigious response...
80
by: Christopher Benson-Manica | last post by:
Of course one can get the effect with appropriate use of existing operators, but a ^^ operator would make for nice symmetry (as well as useful to me in something I'm working on). Am I the only one...
3
by: Filip Kratochvil | last post by:
Hello all, In VB6 I'm able to do the following: If (intValue And 64) = 64 Then ... do something here ... End If
8
by: Chua Wen Ching | last post by:
Hi, I had some beginner questions. Do we need Shift << >> or Logical AND OR XOR operator in our daily programming? I am not sure why i need to use it? I had some samples of c# codes using it. ...
3
by: bob | last post by:
In an effort to keep my UI responsive I have begun to run my time intensive methods on their own thread and in particular the database inserts. I open my DB connection in the constructor and close...
1
by: gilbert.havlik | last post by:
Greetings! Please be so kind and take a few minutes, I believe any mind other than mine can solve this. I am writing a game. As you wander through the gameworld, you may come upon signs. I have...
3
by: youtoo | last post by:
It has been extensively discussed the time complexity (quadratic) of string concatenation (due to string's immutability). But what is: == the time complexity of string indexing? Is it constant?...
3
by: Sumitava Mukherjee | last post by:
Hi all, I am a novice programmer in Python. Please could you explain me the results (regarding logical operators). I get this: True
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.