Introduction to Programming in C - July 2026
Please scroll down for latest Programs 👇
Code compiled and tested successfully!
Due date on 2026-08-14, 23:59 IST
Complete Program
#include <stdio.h>
int find_factorial(int k) {
// --- START OF SOLUTION CODE ---
int fact = 1;
for (int i = 1; i <= k; i++) {
fact *= i;
}
return fact;
// --- END OF SOLUTION CODE ---
}
int main() {
int n, k;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d", &k);
printf("%d", find_factorial(k));
if (i < n - 1) printf(" ");
}
return 0;
}
Code Snippet to Paste in the Editor
// --- START OF SOLUTION CODE ---
int fact = 1;
for (int i = 1; i <= k; i++) {
fact *= i;
}
return fact;
// --- END OF SOLUTION CODE ---
This assignment has Public Test cases. Please click on "Compile & Run" button to see the status of Public test cases. Assignment will be evaluated only after submitting using Submit button below. If you only save as or compile and run the Program, your assignment will not be graded and you will not see your score after the deadline.
Evaluation Results
Note: These tests may not be considered while scoring.
Due date on 2026-08-14, 23:59 IST
Complete Program
#include <stdio.h>
int parking_fee(int hours)
{
// --- START OF SOLUTION CODE ---
if (hours <= 2) {
return hours * 20;
} else {
return 40 + (hours - 2) * 30;
}
// --- END OF SOLUTION CODE ---
}
int main()
{
int hours;
scanf("%d", &hours);
printf("%d", parking_fee(hours));
return 0;
}
Code Snippet to Paste in the Editor
// --- START OF SOLUTION CODE ---
if (hours <= 2) {
return hours * 20;
} else {
return 40 + (hours - 2) * 30;
}
// --- END OF SOLUTION CODE ---
This assignment has Public Test cases. Please click on "Compile & Run" button to see the status of Public test cases. Assignment will be evaluated only after submitting using Submit button below. If you only save as or compile and run the Program, your assignment will not be graded and you will not see your score after the deadline.
Evaluation Results
Note: These tests may not be considered while scoring.
Due date on 2026-08-14, 23:59 IST
Complete Program
// --- START OF SOLUTION CODE ---
#include <stdio.h>
int main() {
char ch;
int k;
scanf(" %c", &ch);
scanf("%d", &k);
printf("%c", (ch - 'a' + k) % 26 + 'a');
return 0;
}
// --- END OF SOLUTION CODE ---
Code Snippet to Paste in the Editor
// --- START OF SOLUTION CODE ---
#include <stdio.h>
int main() {
char ch;
int k;
scanf(" %c", &ch);
scanf("%d", &k);
printf("%c", (ch - 'a' + k) % 26 + 'a');
return 0;
}
// --- END OF SOLUTION CODE ---
This assignment has Public Test cases. Please click on "Compile & Run" button to see the status of Public test cases. Assignment will be evaluated only after submitting using Submit button below. If you only save as or compile and run the Program, your assignment will not be graded and you will not see your score after the deadline.
Evaluation Results
Note: These tests may not be considered while scoring.
No comments:
Post a Comment
Keep your comments reader friendly. Be civil and respectful. No self-promotion or spam. Stick to the topic. Questions welcome.