Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Do u have any example C codes for these?

0 votes
asked Nov 25, 2018 by anonymous
Write a code that multiplies takes name char array names[] and surnames[] and creates name2[] which combine names and surnames.
 

Write a code: You should enter 10 numbers sequentially than sort them with ascending order in another function you call

I need your help for my homestudy , thanks for helps!

3 Answers

–1 vote
answered Nov 26, 2018 by anonymous
l=[]
for i in range(2000, 3201):
if (i%7==0) and (i%5!=0):
l.append(str(i))
print ','.join(l)
commented Nov 27, 2018 by Юрий Гуреев (1,100 points)
I think it`s not C-code))
0 votes
answered Jan 17, 2019 by Jyothi_Rk

Question:Enter 10 numbers sequentially than sort them with ascending order in another function you call

Ans:

#include <stdio.h>
void ascend(int *ptr)
{
  int min,i,j,temp,k;
  for(j=0;j<10;j++)
  {
    min=*(ptr+j);
    for(i=j;i<10;i++)
    {
      if (min>ptr[i])
      {
        min=ptr[i];
        k=i;
      }
    }
    temp=*(ptr+j);
    *(ptr+j)=min;
    *(ptr+k)=temp;
    }
}

void main()
{
    int arr[10],i;
    printf("enter 10 integers\n");
    for(i=0;i<10;i++)
    {
        scanf("%d",&arr[i]);
    }
    ascend(arr);
    printf("After arranging it in ascending order\n");
    for(i=0;i<10;i++)
    {
        printf("%d\t",arr[i]);
    } 
}

0 votes
answered Jan 17, 2019 by Jyothi_Rk

Question: Write a code that multiplies takes name char array names[] and surnames[] and creates name2[] which combine names and surnames.

Ans:

#include <stdio.h>
#include <string.h>
#define MAX_CHAR 100
void main()
{
    char name[MAX_CHAR/2],surname[MAX_CHAR/2],CompleteName[MAX_CHAR];
    int num;
    printf("enter num of names to concatinate\n");
    scanf("%d",&num);
    while(num)
    {
    printf("enter the name\n");
    scanf("%s",name);
    printf("enter the respective surname\n");
    scanf("%s",surname);
    strcpy(CompleteName,name);
    strcat(CompleteName,surname);
    printf("%s\n",CompleteName);
    num--;
    }

}

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...