Question
Can you explane this quastion step by step
29) What is the output of the following program? main () { int i,j,sum= 0, time 01 ; for (i-1;i<6; i++) { j-0; time*=i; while
0 0
Add a comment Improve this question Transcribed image text
Answer #1

The answer is: (e) 173 120

Program:

#include<stdio.h>
main()
{
     int i,j,sum=0,time=01;
     for(i=1;i<6;i++)
     {
      j=0;
      time*=i;
     while(j<i)
     {
     sum+=j;
     j++;
     }
     sum+=time;
     }
     printf ("%d %d",sum,time);
     }

Output:

ТАВ Finished 173 120

Add a comment
Know the answer?
Add Answer to:
Can you explane this quastion step by step 29) What is the output of the following...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In C language 5. What is the OUTPUT of each of these programs? If you aren't...

    In C language 5. What is the OUTPUT of each of these programs? If you aren't confident of an answer, type mpile and run the program to test it. (a) <stdio.h> #include int main main int count; int sum0; for (count 1; count10; count++) sum sum+ count; for count printf("sum= %d\n", return 0; sum); )main (b) #include int main ) <stdio.h> main/ int count; int sum -0 for (count 1 count10; count 2) sum sum + count; for count print...

  • What is the output of the following program? Show each step  to get to the output #include...

    What is the output of the following program? Show each step  to get to the output #include <stdio.h> int f(int* a, int* b); int main() {        int a = 6, b = 7, c = 8;        b = f(&c, &a);        printf("a = %d, b = %d, c = %d\n", a, b, c);           return 0; } int f(int* a, int* b) {        *a = *a + *b;        *b = *a - *b;        printf("a = %d,...

  • OPERATING SYSTWM Question 31 What is the output of this C program? #include #include void main()...

    OPERATING SYSTWM Question 31 What is the output of this C program? #include #include void main() int mptr, *cptr mptr = (int*)malloc(sizeof(int)); printf("%d", "mptr); cptr = (int)calloc(sizeof(int),1); printf("%d","cptr); garbage 0 000 O garbage segmentation fault Question 8 1 pts If this program "Hello" is run from the command line as "Hello 12 3" what is the output? (char '1'is ascii value 49. char '2' is ascii value 50 char'3' is ascii value 51): #include<stdio.h> int main (int argc, char*argv[]) int...

  • Could you please provide a detailed step by step explanation as to how I should go...

    Could you please provide a detailed step by step explanation as to how I should go about obtaining the output shown for each program fragment. Thanks. a) int f1 (int x) { int y=3; printf("%d%d",x,y); return x++; } int main (void) { int y=6, x=4; printf("%d\n",f1(y)); printf("%d%d\n",x,y); return 0; } OUTPUT: x=6, y=36 x=4, y=6 b) void f2(int n, int a[]) { for (int i=0;i<n;i++) a[i] += a[i+1]; } int main() { int A[]={1,2,3,3,4,5};int i, N=6; for (i=0;i<N;i++) printf("%d ",A[i]);...

  • 22. (6 points) Determine the output for the following coe # include < stdio.h > int...

    22. (6 points) Determine the output for the following coe # include < stdio.h > int main(void) ( int z 1, total -0, y printf(d , x) ) //end-for printf("The total %d\n", total) ) //end-main

  • please determine the output in a simple form #include <stdio.h> 2 3 //Item 02 4 int...

    please determine the output in a simple form #include <stdio.h> 2 3 //Item 02 4 int main() 5 6 7 8 9 10 int i for( i = 0 ; i < 5 ; i++ ) ifo 12 13 14 15 16 17 18 19 20 21 printf("A" printf("B"); if i > 2 ) printf("C"); 23 24 25 26 27 28 29 30 31 32 if( i 3) printf( "D") if>4) printf("E 34 35 36 37 38 39 40 41...

  • QUESTION: Explain the output of following C code by showing dry run for each step. main(...

    QUESTION: Explain the output of following C code by showing dry run for each step. main( ) { int a[5] = { 5, 1, 15, 20, 25 } ; int i, j, k = 1, m ; i = ++a[1] ; j = a[1]++ ; m = a[i++] ; printf ( "\n%d %d %d", i, j, m ) ; }

  • the answer should be in C What is the output of the following: int whatIsThat(int *...

    the answer should be in C What is the output of the following: int whatIsThat(int * x); int main() int hold; int x[] = { 2,4,6,8); hold = whatIsThat(x); printf("%d, %d\n", x[0], hold); return 0; } int whatIsThat(int * a) { int i,sum=0; a[0] = a[O] + 6; for(i = 0; i <= 2; i++) (sum+= a[i]; a[i] = a[i] + 12; return sum; a. 20, 20 b. 20, 18 c. 18, 18 d. none of above What is the...

  • 20) What is the output of the following segment of C code: int avg(int n, int*...

    20) What is the output of the following segment of C code: int avg(int n, int* a); int main () {             int array[4]={1,0,6,9};             printf("%d", avg(4, array)+ 1);             system("pause");             return 0; } int avg(int n, int* a) { int i, sum=0; for (i=0;i<n;i++) { sum+=a[i]; } return sum/n; } a) 16 b) 5 c) 4 d) 8 21) What is the output of the following segment of C code: int x = 2; int y = 3;...

  • What is the output of the following c program. Why, Can you tell me how do...

    What is the output of the following c program. Why, Can you tell me how do you solve it? #include <stdio.h> int fun(int n) { if(n==0) { return 1; } else return 7 + fun(n-2); } int main() { printf("%d", fun (4)); return 0; | }

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT