A AB ABC ABCD ABCDE #include <stdio.h> int main() { int i, j; for(i=1;i<=5;i++) { for(j=1;j<=i;j++) { printf("%c",'A' + j-1); } printf("\n"); } return 0; }
the above code is giving error during compiling..... plllzz help.
it is working fine, check this link http://codepad.org/cXIdAfs3
awesome
how can you put a character without declaring it. You printed a character without using in as variable..
printf("%c",'A' + j-1);'A' is a character literal and has its ASCII Value, when you add 1 in 'A' it becomes 'B'
#include#includevoid main(){ char j; int i; clrscr(); for(i=0;i<5;i++){ for(j=65;j<=65+i;j++) printf("%c", j); printf("\n"); } getch();}
how do i write it in couyt statement insted of printf
can u pls. explain ASCII
can anyone tell me how to write this code using cout statements??
guys in java language how can i print any one plz help.
you can go for;for(i=1;i<=5;i++){for(j=1;j<=i;j++){if(i>=j){printf("%c",'A'+j-1);}else{continue;}}printf("/n ");...
this program does not work
this code is not working, it goes for infinite loop.
Simple for above-->#includeint main(){ int i;for(i=1;i<=5;i++){ printf(" %.*s\n",i,"ABCDE"); } return 0;}
I need for n lines
how to give space b/w A and B
printf("\t%c,'A'+j-1);
A B C D E D C B AA B C D D C B AA B C C B AA B B AA A
COULD YOU PLEASE EXPLAIJ THIS
you can use this insted of this to#include "stdio.h"void main(){ int i,j,n=64,s; for(i=1;i<=4;i++) { for(s=1;s<=4-i;s++) { printf(" "); } for(j=n+i;j>=65;j--) { printf("%c",j); } printf("\n"); }}
the above code is giving error during compiling..... plllzz help.
ReplyDeleteit is working fine, check this link http://codepad.org/cXIdAfs3
Deleteawesome
ReplyDeletehow can you put a character without declaring it. You printed a character without using in as variable..
ReplyDeleteprintf("%c",'A' + j-1);
Delete'A' is a character literal and has its ASCII Value, when you add 1 in 'A' it becomes 'B'
#include
ReplyDelete#include
void main()
{ char j;
int i;
clrscr();
for(i=0;i<5;i++){
for(j=65;j<=65+i;j++)
printf("%c", j);
printf("\n");
}
getch();
}
how do i write it in couyt statement insted of printf
ReplyDeletecan u pls. explain ASCII
ReplyDeletecan anyone tell me how to write this code using cout statements??
ReplyDeleteguys in java language how can i print any one plz help.
ReplyDeleteyou can go for;
ReplyDeletefor(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
if(i>=j)
{
printf("%c",'A'+j-1);
}
else
{
continue;
}
}
printf("/n ");
.
.
.
this program does not work
ReplyDeletethis code is not working, it goes for infinite loop.
ReplyDeleteSimple for above-->
ReplyDelete#include
int main()
{ int i;
for(i=1;i<=5;i++)
{
printf(" %.*s\n",i,"ABCDE");
} return 0;
}
I need for n lines
Deletehow to give space b/w A and B
ReplyDeleteprintf("\t%c,'A'+j-1);
DeleteA B C D E D C B A
ReplyDeleteA B C D D C B A
A B C C B A
A B B A
A A
COULD YOU PLEASE EXPLAIJ THIS
ReplyDeleteyou can use this insted of this to
ReplyDelete#include "stdio.h"
void main()
{
int i,j,n=64,s;
for(i=1;i<=4;i++)
{
for(s=1;s<=4-i;s++)
{
printf(" ");
}
for(j=n+i;j>=65;j--)
{
printf("%c",j);
}
printf("\n");
}
}