Q.3 WAP in C/ C++/ java to find the suffix of the given number. Inputs Outputs 1 st 2 nd 3 rd 11 th 21 st 22 nd 23 rd Solution : #include <stdio.h> // char* is a return type for string values char * suffix ( int x) // function to return suffix of number in string form { if (x == 1 || x == 21 || x == 31 ) return "st" ; else if (x == 2 || x == 22 ) return "nd" ; else if (x == 3 || x == 23 ) return "rd" ; else return "th" ; } void main () { int n ; printf ( " \n Enter any positive number : " ); scanf
Get all info & Solution to Java, C & C++ here