THIS BLOG IS COMPLETELY RELATED TO INFORMATION TECHNOLOGY.YOU LEAVE ANY TYPE TECHNICAL COMMENTS OVER HERE RELATED TO PROGRAMMING,TECH NEWS AND IT FIELD.
Monday, October 4, 2010
c language........
can you print '\n' on the screen?
first think yourself......................
......
.......
.......
.......
......
.......
.......
.......
.......
.......
.......
........
here is the answer....
printf("\\n");
Its really nice... but my dear friend... i have a question regarding coding in c language hope u can answer it...
Q: Suppose i have to make a program in "c" in which i have to give the input(any character) from the keyboard and it requires to display the ascii value of of input character dynamically...
Still awaited for your quick response...
neeraj sinha, web programmer, Punjab, Republic of India. Mob: 08969408013
first of all i m very sorry for the lazy response...for the q. above..the simple coding..i m posting...i haven't compiled it yet pls...tell me if it's working....
................................................................................................ #include"stdio.h" #include"conio.h" #include"stdlib.h" main() { char *c; while(1) { printf("enter the character\n"); c=(char*)malloc(sizeof(char)); fflush(stdin); scanf("%c",c); printf("%d\n",*c); } getch(); } ................................................................................................ i welcome ur advices & suggestions........
Its really nice... but my dear friend... i have a question regarding coding in c language hope u can answer it...
ReplyDeleteQ: Suppose i have to make a program in "c" in which i have to give the input(any character) from the keyboard and it requires to display the ascii value of of input character dynamically...
Still awaited for your quick response...
neeraj sinha,
web programmer,
Punjab,
Republic of India.
Mob: 08969408013
first of all i m very sorry for the lazy response...for the q. above..the simple coding..i m posting...i haven't compiled it yet pls...tell me if it's working....
ReplyDelete................................................................................................
#include"stdio.h"
#include"conio.h"
#include"stdlib.h"
main()
{
char *c;
while(1)
{
printf("enter the character\n");
c=(char*)malloc(sizeof(char));
fflush(stdin);
scanf("%c",c);
printf("%d\n",*c);
}
getch();
}
................................................................................................
i welcome ur advices & suggestions........