Program to print one & zero Alternatively
#include
#include
void main()
{
int i,j,n,k=1;
clrscr();
printf("Enter the Iteration Value : ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",k);
if(k==1)
k=0;
else
k=1;
}
printf("\t");
}
getch();
}
Output :
Enter the Iteration Value : 5
1 01 010 1010 10101
10 print "That is not a question." 20 print "That is a command." 30 end
You can use int i; for (i = 10; i <= 50; i += 2) {//print i} as a program to print even numbers between 10 and 50.
int length int breadth int area= (length x breadth) print area
In BASIC: 10 INPUT X: IF X = 999 THEN STOP ELSE PRINT X; 20 IF X/2 = INT(X/2) THEN PRINT "EVEN" ELSE PRINT "ODD" 30 GOTO 10
10 CLS 20 FOR N = 1 TO 10 30 PRINT N, N^2, N^3 40 NEXT N 50 PRINT: PRINT "Oooweee! That was such fun!" 60 END
write a program to print the series 1/12+1/22+.........+1/n2 ?
If you have the series stored in an array, you loop through the array and print each array element in turn. Another possibility is to print out the numbers in the series as you generate them. In that case, you may not need to store anything (depending on the series, of course).
write a program to print A to Z on screen in c?
echo 'print a pattern'
Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.
10 print "That is not a question." 20 print "That is a command." 30 end
This is a directive, not a question.
good morning
Yes.
10 rem for next 20 for i=10 to 1 step -1 30 ? I^2; 40 next i 50 end
Reference:http:cprogramming-bd.com/c_page2.aspx# strange number
You can use int i; for (i = 10; i <= 50; i += 2) {//print i} as a program to print even numbers between 10 and 50.