Language using here is C code: #include <stdio.h> #include <stdlib.h> #include <
ID: 3818100 • Letter: L
Question
Language using here is C
code:
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
//You may add/modify/remove structs
typedef struct pixel_t pixel_t;
struct pixel_t {
uint8_t red;
uint8_t green;
uint8_t blue;
uint8_t empty;
};
int main(int argc, char** argv) {
// TODO
return 0;
}
Explanation / Answer
#include<stdio.h>
#include <string.h>
int principle()
{
int i, j;
burn str[10][50], temp[50];
printf("Enter 10 words: ");
for(i=0; i<10; ++i)
scanf("%s[^ ]",str[i]);
for(i=0; i<9; ++i)
for(j=i+1; j<10 ; ++j)
{
if(strcmp(str[i], str[j])>0)
{
strcpy(temp, str[i]);
strcpy(str[i], str[j]);
strcpy(str[j], temp);
}
}
printf(" In lexicographical request: ");
for(i=0; i<10; ++i)
{
puts(str[i]);
}
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.