Pages

Thursday, January 23, 2025

1. Write a c program to display your Name, address and city in different lines.in C Language

#include<stdio.h>

int main() {

char Name[100], Address[100], City[100];

// Input Name, Address and City...

printf("Enter your Name: ");

fgets(Name, sizeof(Name), stdin);


printf("Enter your Address: ");

fgets(Address, sizeof(Address), stdin);


printf("Enter your City: ");

fgets(City, sizeof(City), stdin);


printf("---Displaying all the information below---");

printf("\nName: %s", Name);

printf("Address: %s", Address);

printf("City: %s", City);


return 0;

}


CODE:- Tested- Works.

No comments:

Post a Comment

Stack using Linked List – Partial (University Exam Topic)

 #include <iostream> using namespace std; struct Node {     int data;     Node* next; }; class Stack {     Node* top; public:     Stac...