It is required to enter characters until a point is encountered. This program does not respond to the point. Where is the mistake? (Or offer, please, your working version)
#include <stdio.h> #include <stdlib.h> int main() { char ar[1000]; char ch; int i = 0; scanf_s("%s", &ch); ar[i] = ch; while ( ch!= '.') { scanf_s("%s", &ch); ar[i] = ch; i++; } system("pause"); return 0; }
scanf_s, and you don’t need it here. Justscanf("%c", &ch);- andy.37