USP

 16-10

0. Random

#include <stdio.h> #include <math.h> int main(void) {int y; char condition; do{ y=rand()%100; printf("%d \n",y); printf("\n want more random number? "); scanf("%c", &condition); }while(condition== 'y' || condition== 'Y'); return 0; }


1. Pointer

#include <stdio.h> #include <math.h> int main(void) { int y=34; int *temp; temp=&y; printf("value at address of y is%d y=%d\n ", *temp, y);//value at printf("\n %u", &y);//value at printf("\n %u", temp);//value at return 0; }


2. Pointer

#include <stdio.h> #include <math.h> int main(void) { int y=34; char arr[10]; int *temp; temp=&y; printf("value at address of y is%d y=%d\n ", *temp, y);//value at printf("\n arr %u", arr); printf("\n arr 0 %u", &arr[0]); printf("\n arr 1 %u", &arr[1]); printf("\n arr 2 %u", &arr[2]);//value at printf("\n %u", temp);//value at return 0; }

Comments

Popular posts from this blog

Final Value of Variable After Performing Operations (LeetCode)

Java Output Formatting | Hackerrank

China will fight six wars in the next 50 years!