I have made a C code that can replace the comma in a number by a decimal point. But my problem is that I also want to calculate the square of the number. Do you have any idea regarding the same?
Code:# include <stdio.h> # include <stdlib.h> int main (int argc, char *argv[]) { char x = 0; while (x != '\n') { scanf ( "%c", &x); if (x == ',') printf ("."); else printf ( "%c", x); } return 0; }
Bookmarks