0
Write a program to find the ASCII code of the symbol '~' which is called as tide.
Printf("%c", ~) is this correct? Or anything else!!! Please do help 🌝me):
5 Antworten
+ 4
printf("%d",'~');
+ 2
Yeah its correct if you are not sure it is correct or not then u can use for loop and inside loop use if condition like this here i work as a counter variable.
#include <stdio.h>
int main() {
for (int i=0;i<255;i++)
{
if(i=='~')
{
printf("ASCII of (~) symbol is %d ",i) ;
}
}
char c='~';
printf("\n%d" ,c);
return 0;
}
+ 2
Swagatika Pradhan no thisone is not valid here your char (c) should be in small letters then in printf u used %d and u writting ~ hypen which is not a valid variable name here you need to write the name of variable which u want to print
See this
#include <stdio.h>
int main()
{
char a= '~';
printf ("%d", a);
return 0;
}
Note : always do dry run before compiling the code and try to fix errors self
+ 1
Thanks a lot👍):
Yaa I'll!
0
Or-
#include <stdio.h>
int main()
{
Char a;
a= '~';
printf ("%d", ~);
return 0;
}