1
o 1
1 0 1
0 1 0 1
1 0 1 0 1
how to design this function format in c-language ?
Answers were Sorted based on User's Feedback
Answer / vignesh1988i
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,n;
clrscr();
printf("enter the terms :");
for(i=1;i<=n;i++)
{
if(i%2==0)
j=1;
else
j=0;
for(k=1;k<=i;k++)
{
j=!j;
printf("%d ",j);
}
printf("\n");
}
getch();
}
thank u
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / premkumar
main()
{
int i,j,k=1; clrscr();
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",k);
if(k==0)k=1;
else k=0;
}
printf("\n");
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Write a program to check whether the number is prime and also check if it there i n fibonacci series, then return true otherwise return false
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }
main() { extern int i; i=20; printf("%d",sizeof(i)); }
main() { char *p="hai friends",*p1; p1=p; while(*p!='\0') ++*p++; printf("%s %s",p,p1); }
main ( ) { static char *s[ ] = {“black”, “white”, “yellow”, “violet”}; char **ptr[ ] = {s+3, s+2, s+1, s}, ***p; p = ptr; **++p; printf(“%s”,*--*++p + 3); }
#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }
void main() { static int i=5; if(--i){ main(); printf("%d ",i); } }
main() { int a=2,*f1,*f2; f1=f2=&a; *f2+=*f2+=a+=2.5; printf("\n%d %d %d",a,*f1,*f2); }
main() { int i=10,j=20; j = i, j?(i,j)?i:j:j; printf("%d %d",i,j); }
Finding a number multiplication of 8 with out using arithmetic operator
Is the following code legal? void main() { typedef struct a aType; aType someVariable; struct a { int x; aType *b; }; }