4 - Chapter 3 C Programming - 1 - 2024
4 - Chapter 3 C Programming - 1 - 2024
4 - Chapter 3 C Programming - 1 - 2024
}
return no input
}
when void is used as a function return type, it
indicates that the function does not return a value.
• In most computer programming languages, a while loop
is a control flow statement that allows code to be
executed repeatedly based on a given Boolean
condition. The Boolean condition is either true or false
while(1)
• It is an infinite loop which will run till a break statement
is issued explicitly. Interestingly not while(1) but any
integer which is non-zero will give the similar effect as
while(1). Therefore, while(1), while(2) or while(-255),
all will give infinite loop only.
while(1) or while(any non-zero integer)
{
// loop runs infinitely
}
• The return value of the main function is
considered the "Exit Status" of the application.
On most operating systems returning 0 is a
success status like saying
"The program worked fine".
Setting and Clearing (masking) bits
while(1)
{
var1 = var1 ^ 0x10;
}
Testing bit with bit-wise operators in C
while(1)
{
if (var1 & 0x20) /* check bit 5 (6th bit) of var1 */
var2 = 0x55; /* this statement is executed if bit 5 is a 1 */
else
var2 = 0xAA; /* this statement is executed if bit 5 is a 0 */
}
...
Bit-wise shift operation in C
• There are two bit-wise shift operators in C.
األسئلة ؟
43
هللا أكبر هللا اكبر هللا اكبر
أشهد أال اله إال هللا
اشهد أال اله إال هللا
أشهد أن محمد رسول هللا
أشهد أن محمد رسول هللا
حي على الصالة حي على الصالة
حي على الفالح حي على الفالح
هللا أكبر هللا أكبر
ال إله إال هللا
وصلى اللهم على سيدنا محمد وآله وصحبه وسلم