Friday, May 22, 2020
Monday, May 18, 2020
Sunday, May 17, 2020
Tip of the day!
Pre/Post increment
In pre-increment operand will be altered in value before it is utilized. In post-increment operand will be altered after it is utilized.
In the above snippet
x = ++a is equivalent to
a = a +1 then
x = a
y = b++ is equivalent to
y = b
then b = b + 1
So the value of y = 10 and b = 11
Saturday, May 16, 2020
Tip of the day!
Note:
Example 2
#include<stdio.h>
int main()
{
float f = 10.4;
float g = 12.3;
int result;
result = (f < g) ? 1 : 0;
printf("%d",&result);
}
what is the output of the above code?
Friday, May 15, 2020
Example 1
#include<stdio.h>
#include<ctype.h>
main()
{
int lower,upper;
lower = getchar();
upper = toupper(lower);
putchar(upper);
}
Questions:
1.) What is the difference between getchar() and putchar() ?
2.) Can getchar() have arguments? Justify the answer.
3.) What is the need for ctype.h header file?
Subscribe to:
Posts (Atom)
Exploring float data type in C
Float is one among the basic data type in C. Floating point numbers in C has precision up to 6 decimal places. T he header file float.h de...
-
Storage class specifiers in C language instructs the compiler where to store a variable, how to store the variable, what is the initial valu...
-
C is obviously the most powerful general purpose programming language for beginners. It is a procedural language which supports structured p...