Home > front end >  why i can't get display last 2 char and it's getting error why? [closed]
why i can't get display last 2 char and it's getting error why? [closed]

Time:09-30

#include <stdio.h>

int main() { 
   char char1 = 'M';
   char char2 = 'A';
   char char3 = 'L';
   char char4 = "I";
   char char5 = "K";

   printf("My name is %c%c%c%c%c",char1,char2,char3,char4,char5);

    return 0;
}

CodePudding user response:

char char3 = 'L';

char char4 = "I";

Can you spot the difference?

If not then the latter is wrong and it should be


char char4 = 'I';
  •  Tags:  
  • c
  • Related