#include <stdio.h>
int main()
{
int i=0,j=0;
// While loop is True until i becomes 10 and when i becomes
10
// j also becomes 10 because both i and j increment by 1 in each
loop
while(i<10 || j<7)
{
i++;
j++;
}
printf("%d, %d\n",i,j);
getchar();
return 0;
}
Ouput:- 10, 10 (Option 2)
#include<stdio.h> eint main() { int i = 0, j = 0; while (i < 10|| j...
what is output #include<stdio.h> pint main() { int i, j, total; for ( 2 { printf("\n"); for ( 2 { total = i + j; printf("%d", total); بہا } getchar(); return 0; } Find the for loop content | Output of progrm 5 15 1 11 21 31 41 51 61 2 12 22 32 25 3 13 23 33 43 53 63 4 14 24 34 44 54 64 35 45 6 16 26 36 46 56 66 7...
#include<stdio.h> sint main() { int k, j, count = 0; for (k = -1; k <= 5; k++) { 1; j--) for (j 4; j >= count++; } printf("count=%d", count); getchar(); return 0; بها count =28 count -21 couunt =28 count =15
6. Consider the following program: #include <stdio.h> main() { int a,b,c,d ; a=0; while (1) { printf("%d\n", a); printf("Input? "); scanf("%d",&c); if (c == 0) break; d=0; for (b=1; b<=c; b++) if (c%b == 0) d++; if (d == 2 11 C == 1) a=a+c; } } What does this program do? Rewrite the code, organizing it using sound principles. Include comments and redo variable names and indentation. Use multiple functions, blocks, and/or preprocessing if you deem it necessary.
What is the functionality of the following code? #include #include mainO <stdio.h> <unistd.h> int i,j; j-0: printf ("Ready to fork.n) i-fork; if 0) this code.\n"); printf "The child executes for (i-0; i?5; i++) printf("Child j-dn".j); else j-vaito printf("The parent executes this code. Ln" printf ("Parent j-dn",j);
#include<stdio.h> int main() { int data[10], i, j, temp; printf("Enter 10 random number to sort in ascending order:\n"); for(i = 0; i < 10; i++) scanf("%d", &data[i]); /* Sorting process start */ ****** INSERT YOUR CODE TO COMPLETE THE PROGRAM ****** printf("After sort\n"); for(i = 0; i < 10; i++) printf("%d\n",data[i]); return 0; } Looking for alternative solutions for the program code.
What is printed when the following code is executed? #include <stdio.h> int main() { for (int i=3, j=5; i>=0; i-=2, j+=j*i) { printf("%d", j); منم }
i need flowchart for the following c code #include <stdio.h> int main() { int n, i, sum = 0; printf("Enter an integer: "); scanf("%d",&n); i = 1; while ( i <=n ) { sum += i; ++i; } printf("Sum = %d",sum); return 0; }
Question 3 Predict the output of the following C program: #include <stdio.h> void main() { int i = 0; for(; 1; i++){ printf("%d",i); if(i==7) break; } 12pt Paragraph 1 Β Ι Ο Αν και Ta
#include<stdio.h> #include<stdio.h> int main(){ int i; //initialize array char array[10] = {“Smith”, “Owen”, “Kowalczyk”, “Glass”, “Bierling”, “Hanenburg”, “Rhoderick”, “Pearce”, “Raymond”, “Kamphuis”}; for(int i=0; i<8;i++){ for(int j=0; j<9; j++){ if(strcmp(array[j],array[j+1])>0){ char temp[20]; strcpy(temp,array[j]); strcpy(array[j],array[j+1]); strcpy(array[j+1],temp); } } } printf(“---------File Names---------\n”); for(inti=0; i<9; i++){ printf(“\t%s\n”,array[i]); } printf(-------5 Largest Files according to sorting----\n”); for(int i=0;i>=5;i--) { printf(“\t%s\n”,array[i]); } return0; } Consider the "sort" program (using with void* parameters in the bubblesort function) from the week 10 "sort void" lecture. Modify it as follows...
#include "stdio.h" int main() { float array[5][3],rowsum=0.0,colsum=0.0; int i,j; for(i=0;i<5;i++){ printf("Enter the %d elements of array:\n",i); for(j=0;j<3;j++){ scanf("%f",&array[i][j]); } } printf("Given table data:\n"); for(i=0;i<5;i++){ for(j=0;j<3;j++){ printf(" %0.1f",array[i][j]); } printf("\n"); } for(i=0;i<5;i++){ for(j=0;j<3;j++){ rowsum=rowsum+array[i][j]; } printf("sum of the %d row is %0.1f\n",i,rowsum); rowsum=0; } for(j=0;j<3;j++){ colsum+=array[j][i]; printf("Sum of %d coloumn is %0.1f\n",j,colsum); colsum=0; } return(0); } can someone help me to get the correct row sum and column sum in c program