main()
{
printf("hellow world");
}
#include <stdio.h>
int main()
{
int x, y;
x=5;
printf("x = %d\n", x);//gives defined value of x
printf("x = %d\n", x++);//gives x =5 but only for display, actual value stored in memory is 6.
printf("x = %d\n", x--);//gives x = 6 for display but actual value stored in memory is 5
printf("x = %d\n", --x);//gives x = 4 due to prefix properties
printf("x = %d\n", ++x);//gives x =5 due to the same
}
#include<stdio.h>
main()
{
int x,y;
x=9;
y=x--;
printf("%i",y);//nilai x tetap ditampilkan 9, distore memori 8. namun jika x dianggil lagi makan nailai x yang dimemoriyang bernilai 8 dimunculkan.
printf("%i",x);
}
#include<stdio.h>
main()
{
int x,y;
x=9;
y=++x;
printf("%i",y); result 10
printf("%i",x);//karena y terakhir=x result 10
}
Tidak ada komentar:
Posting Komentar