please I need help with this Q , write flowchart for the following codes and notice that they are one part of the Q. *
please I need help with this Q , write flowchart for the following codes and notice that they are one part of the Q.
*
#include<stdio.h>
#define s 3
#define a 2
int main()
{
int k[s][a];
int i,j;
float aver;
printf("p;ease enter array values:");
for(i=0;i<s;i++){
for(j=0;j<a;j++){
printf("\narray value:",i,j);
scanf("%d",&k[i][j]);
}
}
aver= 0;
for(i=0;i<s;i++){
for(j=0;j<a;j++){
aver+=k[i][j];
}
}
aver=aver/(s*a);
printf("\nAverage=%.3f,aver");
return 0;
}
*
#include<stdio.h>
int main()
{
int num,count=1, sum=0;
printf("enter a positive integer:");
scanf("%d",&num);
//for loop terminates when sum is less than count
while(count<=num)
{
sum=sum+count;
count++;
}
printf("sum=%d",sum);
return 0;
}
Step by step
Solved in 6 steps with 5 images