Hi Everyone!
I am trying to store string input with spaces and the program should stop taking the input while the enter key is pressed.
Code:#include<stdio.h> int main() { char c[25]; int i=0; printf("Enter your fullname\n"); while(c[i]!= ) // not sure how to check for enter key pressed { scanf("%c",&c[i]); i++; } c[i]='\0'; printf("the given name\n"); i=0; while(c[i]!='\0') { printf("%c",c[i]; i++; } printf("\n"); return 0; }