What will be the output of the following program
the output is
Egypt
explanation
string name is the base address of the string variable which is an array of characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(int argc, char **argv) | |
{ | |
char s[]="Egypt"; | |
for(int i=0;*("Egypt"+i)!='\0';i++) | |
{ | |
printf("%c",s[i]); | |
} | |
return 0; | |
} |
Egypt
explanation
string name is the base address of the string variable which is an array of characters
No comments:
Post a Comment