Answers for "%[^~] vs %[^\n] in c"

C
0

%[^~] 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 

}
Posted by: Guest on May-17-2021

Code answers related to "C"

Browse Popular Code Answers by Language