program in c to print 1 to 100 without using loop

Answer Posted / madhavi

main()
{
int i=1;
LOOP:
printf("%d\t",i);
i++;
if(i<=100)
goto LOOP;
}

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

why programs in c are running with out #include? some warnings are display in terminal but we execute the program we get answer why? eg: main() { printf("hello world "); }

1318


How can a program be made to print the name of a source file where an error occurs?

732


When should the const modifier be used?

660


What is the difference between strcpy() and memcpy() function in c programming?

628


All technical questions

1512






Write a C program linear.c that creates a sequence of processes with a given length. By sequence it is meant that each created process has exactly one child. Let's look at some example outputs for the program. Here the entire process sequence consists of process 18181: Sara@dell:~/OSSS$ ./linear 1 Creating process sequence of length 1. 18181 begins the sequence. An example for a sequence of length three: Sara@dell:~/OSSS$ ./linear 3 Creating process sequence of length 3. 18233 begins the sequence. 18234 is child of 18233 18235 is child of 18234 ........ this is coad .... BUt i could not compleate it .....:( #include #include #include #include int main(int argc, char *argv[]) { int N; pid_t pid; int cont; if (argc != 2) { printf("Wrong number of command-line parameters!\n"); return 1; } N = atoi(argv[1]); printf("Creating process sequence of length %d.\n",N); printf("%d begins the sequence.\n",getpid()); /* What I have to do next ?????? */ }

1621


What is the function of volatile in c language?

669


Is c++ based on c?

656


What is #define used for in c?

616


What are the general description for loop statement and available loop types in c?

689


What are types of preprocessor in c?

621


If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..

1595


What is the difference between the expression “++a” and “a++”?

651


What is the role of && operator in a program code?

569


Explain what is gets() function?

635