TOPIC
Compilation error
SHUVRA ADITYA (IIT_NSTU) (͡ ° ͜ʖ ͡ °) asked 1 year ago
#include<stdio.h>
int main()
{
int T, key;
scanf("%d",&T);
char ch[52];
for(int i=0; i<T; i++)
{
getchar();
scanf("%[^\n]s",&ch);
scanf("%d",&key);
int j=0;
while(ch[j]!='\0')
{
if(ch[j]-key<65)
printf("%c",ch[j]-key+26);
else
printf("%c",ch[j]-key);
j++;
}
printf("\n");
ch[0]='\0';
}
return 0;
}
Why my above code giving Compailation error in c lannguage. But it get accepted in c++17. What is the reason?