mardi 19 mai 2020

how to give a array input for if statement in c?

# include <stdio.h>


void danidev(void){
 printf("Dani is a YouTuber and an indie game developer and an fps game developer having his game published in play store he is 22 years old and goes to a university");
}

void brackeys(void){
    printf("brackeys is a YouTuber and an indie game developer and also an fps game developer having most of his games published in itch.io and has a team which works on game development");
}

void blackthornprod(void){
    printf("  they are two brothers who create video games and teach others how to do the same over on Youtube and Udemy ! they are passionate in sharing their knowledge and game creation journey with other aspiring game developers.");
}

void jabrils(void){
 printf("jabrils is a ai programmer and also a machine learning pro coder and also a game developer he has made a lot of ai and has saved millions of people from their tough times");
}

void codingbullet(void){
 printf("coding bullet is a multi intelligent ai developer and also a master in machine learning also he owns a youtube channel with 2.06 million subscribers");
}

int main(){

 printf("HERE IS THE INFORMATION OF FAMOUS CODING YOUTUBERS(PLS TYPE THE FOLLWOING YOUTUBERS NAME): ");
 char b;
 scanf("%c",&b);
 if(b=='danidev'){
 danidev(); 
 }
 else if(b=='brackeys'){
 brackeys();
 }
 else if(b=='blackthornprod'){
 blackthornprod();
 }
 else if(b=='jabrils'){
 jabrils();
 }
 else if(b=='codingbullet'){
 codingbullet();
 }
 else{
 printf(" i dont know what you are taking about");
 }

return 0;
}

I have a problem when I enter a YouTubers name ( complete name) as an input I get a problem that the constant is too long and does not give the proper result and also it says the constant character is too long for its type

Aucun commentaire:

Enregistrer un commentaire