#source code:
#include <stdio.h>
int fun(int a,int c){ //function definition
return a+c;
}
int main(){
int a,b,c,d; //here decalre the variables
a=0; //here initialize the variable a with 0
while(1){
printf("%d\n",a); //here print the a value
printf("Input? ");
scanf("%d",&c);
if(c==0){
break;
}
d=0;
for(b=1;b<=c;b++){ //for loop used for the iteration
if(c%b==0){ //in for loop we have if
d++;
}
}
if(d==2 || c==1){ //if condition here
a=fun(a,c); //invoke the function
}
}
return 0;
}
#output:
#if you have any doubt or more information needed comment below..i will respond as possible as soon..thanks..
6. Consider the following program: #include <stdio.h> main() { int a,b,c,d ; a=0; while (1) {...
All in C please~ #1 Consider this program: #include <stdio.h> int main () { /* main */ constint constant1 = 10, constant2 = 20, constant3 = 14; int input_value; char current_truth; printf("What is the input value?\n"); scanf("%d", &input_value); current_truth = input_value > constant1; printf("current_truth = %d\n", current_truth); current_truth = current_truth && (input_value < constant2); printf("current_truth = %d\n", current_truth); current_truth = current_truth && (input_value == constant3); printf("current_truth = %d\n", current_truth); } /* main */ What is the output of this program...
Translate the following C program to Pep/9 assembly language. #include <stdio.h> int main() { int number; scanf("%d", &number); if (number % 2 == 0) { printf("Even\n"); } else { printf("Odd\n"); } return 0; }
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> eint main() { int i = 0, j = 0; while (i < 10|| j < 7) { i++; j++; } printf("%d, %d\n", i, j); getchar(); return 0; } 01,01 10,10 7.7 10,7
Translate the following C program to Pep/9 assembly language. #include <stdio.h> const int limit = 5; int main() { int number; scanf("%d",&number); while (number < limit){ number++; printf("%d",number); } return 0; }
Convert the below C code to basic MIPS. Leave comments for explanation please #include <stdio.h> int main(void) { printf("Insert two numbers\n"); int a,b,c; scanf("%d",&a); scanf("%d",&b); c=a|b; printf("%d|%d=%d\n",a,b,c); return 0; }
Convert the below C code to basic MIPS. Please leave comments for explanation #include <stdio.h> int main(void) { printf("Insert two numbers\n"); int a,b; scanf("%d",&a); scanf("%d",&b); a=a<<2; b=b<<2; printf("%d&%d\n",a,b); return 0; }
Convert this C program to Js (Java script) from Visual Studio Code #include<stdio.h> int main(){ char firstName[100]; char lastName[100]; printf("Enter Your Full Name: \n"); scanf("%s %s", firstName, lastName); printf("First Name: %s\n", firstName); printf("Last Name: %s\n", lastName); return 0; }
Complete this program in C #include<stdio.h> int main(void) { int sumA(__, __); int answer; //the two parameters are start and end addresses of intA[] answer = sumA(......); printf("..........", intA); printf("The sum of integers in intA is %d.\n", answer); return 0; } //the two parameters of sumA(__, __) are start and end addresses of intA[] int sumA(..........) { ……………………. return ............. }