%[^~] vs %[^\n] in c
#include<stdio.h>
#include<math.h>
int main()
{
char num[50],num1[50];
printf("enter the strings \n");
scanf("%[^.]",&num);//if you enter . as a part of your string there after it ignores all chracters
printf("\n%s",num);
printf("enter the strings \n");
scanf("%[^~]",&num1);//if you enter ~ as a part of your string there after it ignores all chracters
printf("\n%s",num1);
//not only special characters same also with \n and \t
}