Problem Description
Find largest of 2 numbers using pointers in cTest Case 1
Input (stdin)23 45
Expected Output45
Test Case 2
Input (stdin)40 30
Expected Output40
Program
#include <stdio.h> int main() { int x,y; int *a,*b; scanf("%d %d",&x,&y); a=&x; b=&y; if(*a>*b) { printf("%d",*a); } else { printf("%d",*b); } return 0; }
No comments:
Post a Comment
Note: only a member of this blog may post a comment.