Answers for "add a number to a table langage c"

C
0

add a number to a table langage c

#include <stdio.h>
int main(void) {
 int i,n,x,t[n],tab[n];
printf("How long do you want your table? :");
scanf("%d",&n);
 for (i=0;i<n;i++){
printf("enter the %d number :",i+1);
scanf("%d",&t[i]);
 }
 printf("What number do you want to add to the table? :");
 scanf("%d",&x);
 printf("the new tab is : \n");
 for (i=0;i<n;i++){
   tab[i]=t[i]+x;
   printf("%d\n",tab[i]);
 }

  return 0;
  }
Posted by: Guest on July-05-2021

Code answers related to "C"

Browse Popular Code Answers by Language