abcdedcba
abc cba
ab ba
a a
Answers were Sorted based on User's Feedback
Answer / p.pratyusha
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i=5,q,n=-1,r;
for(q=0;q<i;q++)
{
char ch='A';
for(int j=0;j<i;j++)
{
cout<<ch;
++ch;
}
if(n>0)
{
for(int k=n;k>0;k--)
{
cout<<" ";
}
}
for(r=0;r<i-1;r--)
{
ch--;
cout<<ch;
}
cout<<endl;
n+=2;
--i;
}
}
| Is This Answer Correct ? | 1 Yes | 1 No |
#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s=malloc(sizeof(struct xx)); printf("%d",s->x); printf("%s",s->name); }
void main() { if(~0 == (unsigned int)-1) printf(“You can answer this if you know how values are represented in memory”); }
code of a program in c language that ask a number and print its decremented and incremented number.. sample output: input number : 3 321123
How can I Create a C program in splitting set of characters to specific subsets. Example: INPUT SET OF CHARACTERS: Therefore, my dear brothers and sisters, stand firm. Let nothing move you. Always give yourselves fully to the work of the Lord, because you know that your labor in the Lord is not in vain. SPLIT INTO HOW MANY CHARACTERS PER SUBSETS: 10 OUTPUT: Therefore, my dear b rothers an d sisters, stand fir m. Let not hing move you. Alway s give you rselves fu lly to the work of t he Lord, b ecause you know that your labo r in the L ord is not in vain.
# include<stdio.h> aaa() { printf("hi"); } bbb(){ printf("hello"); } ccc(){ printf("bye"); } main() { int (*ptr[3])(); ptr[0]=aaa; ptr[1]=bbb; ptr[2]=ccc; ptr[2](); }
#include<stdio.h> void fun(int); int main() { int a; a=3; fun(a); printf("\n"); return 0; } void fun(int i) { if(n>0) { fun(--n); printf("%d",n); fun(--n); } } the answer is 0 1 2 0..someone explain how the code is executed..?
#define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); }
/*what is the output for*/ void main() { int r; printf("Naveen"); r=printf(); getch(); }
main() { char str1[] = {‘s’,’o’,’m’,’e’}; char str2[] = {‘s’,’o’,’m’,’e’,’\0’}; while (strcmp(str1,str2)) printf(“Strings are not equal\n”); }
‎#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }
main() { int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }
main() { char *p="hai friends",*p1; p1=p; while(*p!='\0') ++*p++; printf("%s %s",p,p1); }